Commit 4517b882 authored by David Moxey's avatar David Moxey

Fix various comments, change CADSurf and CADCurve to use m_ for member variables

parent dba6494d
......@@ -96,8 +96,8 @@ MARK_AS_ADVANCED(NEKTAR_BUILD_PACKAGES)
OPTION(NEKTAR_TEST_ALL "Include full set of regression tests to this build." OFF)
# meshing and cad options
OPTION(NEKTAR_USE_OCC "Use opencascade for geometry interface." OFF)
# Meshing and CAD options
OPTION(NEKTAR_USE_OCC "Use OpenCascade for geometry interface." OFF)
# Build options
OPTION(NEKTAR_FULL_DEBUG "Enable Full Debugging." OFF)
......
########################################################################
#
# ThirdParty configuration for Nektar++
#
# OpenCascade
#
########################################################################
IF(NEKTAR_USE_OCC)
SET(BUILD_OCC ON)
SET(BUILD_OCC ON)
OPTION(THIRDPARTY_DOWNLOAD_OCC
"Get OpenCascade from ThirdParty." ${BUILD_OCC})
OPTION(THIRDPARTY_DOWNLOAD_OCC
"Get OpenCascade from ThirdParty." ${BUILD_OCC})
IF (THIRDPARTY_DOWNLOAD_OCC)
IF(WIN32)
message(SEND_ERROR "Cannot use opencascade with Nektar++ on windows")
ELSEIF(APPLE)
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
opencascade-6.8
PREFIX ${TPSRC}
URL http://ae-nektar.ae.ic.ac.uk/~mt4313/OCC680osx64.tgz
URL_MD5 626292523b0691304f0fa271989fbc44
STAMP_DIR ${TPBUILD}/stamp
BINARY_DIR ${TPBUILD}/opencascade-6.8
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/opencascade-6.8
INSTALL_DIR ${TPDIST}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND cp -a ${TPSRC}/opencascade-6.8/i686/lib/. ${TPDIST}/lib/ COMMAND cp -a ${TPSRC}/opencascade-6.8/i686/inc/. ${TPDIST}/include/
)
SET(OCC_LIBS PTKernel TKernel TKMath TKBRep TKIGES TKSTEP TKSTEPAttr TKSTEP209 TKSTEPBase TKShapeSchema TKGeomBase TKGeomAlgo TKG3d TKG2d TKXSBase TKPShape TKTopAlgo)
LINK_DIRECTORIES(${TPDIST}/lib)
INCLUDE_DIRECTORIES(SYSTEM ${TPDIST}/include)
ELSE()
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
opencascade-6.8
PREFIX ${TPSRC}
URL http://ae-nektar.ae.ic.ac.uk/~mt4313/OCC680lin64.tgz
URL_MD5 d655b6f50998bb9600e081907c247793
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/opencascade-6.8
INSTALL_DIR ${TPDIST}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND INSTALL_COMMAND cp -a ${TPSRC}/opencascade-6.8/i686/lib/. ${TPDIST}/lib/ COMMAND cp -a ${TPSRC}/opencascade-6.8/i686/inc/. ${TPDIST}/include/
)
SET(OCC_LIBS PTKernel TKernel TKMath TKBRep TKIGES TKSTEP TKSTEPAttr TKSTEP209 TKSTEPBase TKShapeSchema TKGeomBase TKGeomAlgo TKG3d TKG2d TKXSBase TKPShape TKTopAlgo)
LINK_DIRECTORIES(${TPDIST}/lib)
INCLUDE_DIRECTORIES(SYSTEM ${TPDIST}/include)
ENDIF()
ENDIF (THIRDPARTY_DOWNLOAD_OCC)
IF (THIRDPARTY_DOWNLOAD_OCC)
IF(WIN32)
MESSAGE(SEND_ERROR "Cannot use OpenCascade with Nektar++ on Windows")
ELSEIF(APPLE)
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
opencascade-6.8
PREFIX ${TPSRC}
URL http://ae-nektar.ae.ic.ac.uk/~mt4313/OCC680osx64.tgz
URL_MD5 626292523b0691304f0fa271989fbc44
STAMP_DIR ${TPBUILD}/stamp
BINARY_DIR ${TPBUILD}/opencascade-6.8
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/opencascade-6.8
INSTALL_DIR ${TPDIST}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND cp -a ${TPSRC}/opencascade-6.8/i686/lib/. ${TPDIST}/lib/ COMMAND cp -a ${TPSRC}/opencascade-6.8/i686/inc/. ${TPDIST}/include/
)
LINK_DIRECTORIES(${TPDIST}/lib)
INCLUDE_DIRECTORIES(SYSTEM ${TPDIST}/include)
ELSE()
INCLUDE(ExternalProject)
EXTERNALPROJECT_ADD(
opencascade-6.8
PREFIX ${TPSRC}
URL http://ae-nektar.ae.ic.ac.uk/~mt4313/OCC680lin64.tgz
URL_MD5 d655b6f50998bb9600e081907c247793
STAMP_DIR ${TPBUILD}/stamp
DOWNLOAD_DIR ${TPSRC}
SOURCE_DIR ${TPSRC}/opencascade-6.8
INSTALL_DIR ${TPDIST}
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND cp -a ${TPSRC}/opencascade-6.8/i686/lib/. ${TPDIST}/lib/ COMMAND cp -a ${TPSRC}/opencascade-6.8/i686/inc/. ${TPDIST}/include/
)
LINK_DIRECTORIES(${TPDIST}/lib)
INCLUDE_DIRECTORIES(SYSTEM ${TPDIST}/include)
ENDIF()
SET(OCC_LIBS PTKernel TKernel TKMath TKBRep TKIGES TKSTEP TKSTEPAttr
TKSTEP209 TKSTEPBase TKShapeSchema TKGeomBase TKGeomAlgo TKG3d TKG2d
TKXSBase TKPShape TKTopAlgo)
ENDIF (THIRDPARTY_DOWNLOAD_OCC)
ENDIF(NEKTAR_USE_OCC)
......@@ -36,22 +36,37 @@
#include <LibUtilities/CADSystem/CADCurve.h>
using namespace std;
namespace Nektar{
namespace LibUtilities{
namespace Nektar {
namespace LibUtilities {
/**
* @brief Default constructor.
*/
CADCurve::CADCurve(int i, TopoDS_Shape in) : m_ID(i)
{
gp_Trsf transform;
gp_Pnt ori(0.0, 0.0, 0.0);
transform.SetScale(ori, 1.0 / 1000.0);
TopLoc_Location mv(transform);
in.Move(mv);
m_occCurve = BRepAdaptor_Curve(TopoDS::Edge(in));
}
/**
* @brief Calculates the parametric coordinate and arclength location
* defined by \p s.
*
* @param s arclength location
* @return calculated parametric coordinate
* @param s Arclength location.
* @return Calculated parametric coordinate.
*
* @todo This really needs improving for accuracy.
*/
NekDouble CADCurve::tAtArcLength(NekDouble s)
{
NekDouble dt = (occCurve.LastParameter() -
occCurve.FirstParameter()) / (5000);
NekDouble t = occCurve.FirstParameter();
NekDouble dt = (m_occCurve.LastParameter() -
m_occCurve.FirstParameter()) / (5000);
NekDouble t = m_occCurve.FirstParameter();
NekDouble len = 0.0;
......@@ -60,33 +75,29 @@ NekDouble CADCurve::tAtArcLength(NekDouble s)
gp_Pnt P1,P2;
gp_Vec drdt1,drdt2;
occCurve.D1(t,P1,drdt1);
m_occCurve.D1(t,P1,drdt1);
t += dt;
occCurve.D1(t,P2,drdt2);
m_occCurve.D1(t,P2,drdt2);
len += (drdt1.Magnitude() + drdt2.Magnitude()) / 2.0 * dt;
}
return t - dt;
///@todo this really needs improving for accuracy
}
/**
* @brief Calculates the arclength between the two paremetric points \p ti
* and \p tf. \p ti must be less than \p tf
* and \p tf. \p ti must be less than \p tf.
*
* @param ti first parametric coordinate
* @param tf second parametric coordinate
* @return arc length between \p ti and \p tf
* @param ti First parametric coordinate.
* @param tf Second parametric coordinate.
* @return Arc length between \p ti and \p tf.
*/
NekDouble CADCurve::Length(NekDouble ti, NekDouble tf)
{
NekDouble len = 0;
NekDouble dt = (occCurve.LastParameter() -
occCurve.FirstParameter()) / (1000 - 1);
NekDouble dt = (m_occCurve.LastParameter() -
m_occCurve.FirstParameter()) / (1000 - 1);
NekDouble t = ti;
while(t + dt <= tf)
......@@ -94,9 +105,9 @@ NekDouble CADCurve::Length(NekDouble ti, NekDouble tf)
gp_Pnt P1,P2;
gp_Vec drdt1,drdt2;
occCurve.D1(t,P1,drdt1);
m_occCurve.D1(t,P1,drdt1);
t += dt;
occCurve.D1(t,P2,drdt2);
m_occCurve.D1(t,P2,drdt2);
len += (drdt1.Magnitude() + drdt2.Magnitude()) / 2.0 * dt;
}
......@@ -105,17 +116,15 @@ NekDouble CADCurve::Length(NekDouble ti, NekDouble tf)
}
/**
* @brief Gets the location x,y,z in array out of the curve at point \p t.
* @brief Gets the location (x,y,z) in an array out of the curve at point \p t.
*
* @param t parametric coordinate
* @return array of x,y,z
* @param t Parametric coordinate
* @return Array of x,y,z
*/
Array<OneD, NekDouble> CADCurve::P(NekDouble t)
{
Array<OneD, NekDouble> location(3);
gp_Pnt loc = occCurve.Value(t);
gp_Pnt loc = m_occCurve.Value(t);
location[0] = loc.X();
location[1] = loc.Y();
......@@ -125,50 +134,41 @@ Array<OneD, NekDouble> CADCurve::P(NekDouble t)
}
/**
* @brief returns the minimum and maximum parametric coords t of the curve.
* @brief Returns the minimum and maximum parametric coords t of the curve.
*
* @return array of two entries, min and max parametric coordinate
* @return Array of two entries, min and max parametric coordinate.
*/
Array<OneD, NekDouble> CADCurve::Bounds()
{
Array<OneD, NekDouble> t(2);
t[0] = occCurve.FirstParameter();
t[1] = occCurve.LastParameter();
t[0] = m_occCurve.FirstParameter();
t[1] = m_occCurve.LastParameter();
return t;
}
CADCurve::CADCurve(int i, TopoDS_Shape in) : ID(i)
{
gp_Trsf transform;
gp_Pnt ori(0.0, 0.0, 0.0);
transform.SetScale(ori, 1.0 / 1000.0);
TopLoc_Location mv(transform);
in.Move(mv);
occCurve = BRepAdaptor_Curve(TopoDS::Edge(in));
}
/**
* @brief gets opencascade point objects for the start and end of the curve.
* @brief Gets OpenCascade point objects for the start and end of the curve.
*
* @return array with 6 entries of endpoints x1,y1,z1,x2,y2,z2
* @return Array with 6 entries of endpoints x1,y1,z1,x2,y2,z2.
*/
Array<OneD, NekDouble> CADCurve::GetMinMax()
{
Array<OneD, NekDouble> locs(6);
gp_Pnt start = occCurve.Value(occCurve.FirstParameter());
gp_Pnt end = occCurve.Value(occCurve.LastParameter());
locs[0]=start.X();
locs[1]=start.Y();
locs[2]=start.Z();
locs[3]=end.X();
locs[4]=end.Y();
locs[5]=end.Z();
return locs;
gp_Pnt start = m_occCurve.Value(m_occCurve.FirstParameter());
gp_Pnt end = m_occCurve.Value(m_occCurve.LastParameter());
locs[0] = start.X();
locs[1] = start.Y();
locs[2] = start.Z();
locs[3] = end.X();
locs[4] = end.Y();
locs[5] = end.Z();
return locs;
}
}
......
......@@ -33,7 +33,6 @@
//
////////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_LIB_UTILITIES_CADSYSTEM_CADCURVE_H
#define NEKTAR_LIB_UTILITIES_CADSYSTEM_CADCURVE_H
......@@ -51,57 +50,47 @@ namespace LibUtilities {
/**
* @brief class for CAD curves.
*
* This class wraps the opencascade BRepAdaptor_Curve class for use with
* nektar++
* This class wraps the OpenCascade BRepAdaptor_Curve class for use with
* Nektar++.
*/
class CADCurve
{
public:
friend class MemoryManager<CADCurve>;
/**
* @brief Defualt constructor.
*/
CADCurve(int i, TopoDS_Shape in);
Array<OneD, NekDouble> Bounds();
NekDouble Length(NekDouble ti, NekDouble tf);
Array<OneD, NekDouble> P(NekDouble t);
NekDouble tAtArcLength(NekDouble s);
Array<OneD, NekDouble> GetMinMax();
int GetID(){return ID;}
int GetID()
{
return m_ID;
}
void SetAdjSurf(std::vector<int> i)
{
adjSurfs=i;
m_adjSurfs = i;
}
std::vector<int> GetAdjSurf()
{
return adjSurfs;
return m_adjSurfs;
}
Array<OneD, NekDouble> GetMinMax();
private:
/// ID of the curve
int ID;
/// OpenCascade object of the curve
BRepAdaptor_Curve occCurve;
/// List of surfaces which this curve belongs to
std::vector<int> adjSurfs;
/// ID of the curve.
int m_ID;
/// OpenCascade object of the curve.
BRepAdaptor_Curve m_occCurve;
/// List of surfaces which this curve belongs to.
std::vector<int> m_adjSurfs;
};
typedef boost::shared_ptr<CADCurve> CADCurveSharedPtr;
}
}
......
......@@ -36,43 +36,43 @@
#include <LibUtilities/CADSystem/CADSurf.h>
using namespace std;
namespace Nektar{
namespace LibUtilities{
namespace Nektar {
namespace LibUtilities {
CADSurf::CADSurf(int i, TopoDS_Shape in,
vector<vector<pair<int,int> > > ein) : ID(i), edges(ein)
vector<vector<pair<int,int> > > ein) : m_ID(i), m_edges(ein)
{
//this bit of code changes the units of the cad from mm opencascade
//defualt to m
// this bit of code changes the units of the cad from mm opencascade
// defualt to m
gp_Trsf transform;
gp_Pnt ori(0.0, 0.0, 0.0);
transform.SetScale(ori, 1.0 / 1000.0);
TopLoc_Location mv(transform);
s = BRep_Tool::Surface(TopoDS::Face(in));
m_s = BRep_Tool::Surface(TopoDS::Face(in));
in.Move(mv);
occSurface = BRepAdaptor_Surface(TopoDS::Face(in));
m_occSurface = BRepAdaptor_Surface(TopoDS::Face(in));
}
/**
* @brief performs a reverse look up to find u,v and x,y,z.
* @brief Performs a reverse look up to find u,v and x,y,z.
*
* @param p array of xyz location
* @return the parametric location of xyz on this surface
* @param p Array of xyz location
* @return The parametric location of xyz on this surface
*/
Array<OneD, NekDouble> CADSurf::locuv(Array<OneD, NekDouble> p)
{
//has to transfer back to mm
gp_Pnt loc(p[0] * 1000.0, p[1] * 1000.0, p[2] * 1000.0);
GeomAPI_ProjectPointOnSurf projection(loc, s,
occSurface.FirstUParameter(),
occSurface.LastUParameter(),
occSurface.FirstVParameter(),
occSurface.LastVParameter(),
GeomAPI_ProjectPointOnSurf projection(loc, m_s,
m_occSurface.FirstUParameter(),
m_occSurface.LastUParameter(),
m_occSurface.FirstVParameter(),
m_occSurface.LastVParameter(),
Extrema_ExtAlgo_Tree);
ASSERTL0(projection.NbPoints()>0, "locuv failed");
ASSERTL0(projection.NbPoints() > 0, "locuv failed");
Quantity_Parameter ui;
Quantity_Parameter vi;
......@@ -93,16 +93,15 @@ Array<OneD, NekDouble> CADSurf::locuv(Array<OneD, NekDouble> p)
/**
* @brief Get the x,y,z at parametric point u,v.
*
* @param uv array of u and v parametric coords
* @return array oc xyz location
* @param uv Array of u and v parametric coords.
* @return Array of xyz location.
*/
Array<OneD, NekDouble> CADSurf::P(Array<OneD, NekDouble> uv)
{
/// @todo create bound checking
Array<OneD, NekDouble> location(3);
gp_Pnt loc;
loc = occSurface.Value(uv[0], uv[1]);
loc = m_occSurface.Value(uv[0], uv[1]);
location[0] = loc.X();
location[1] = loc.Y();
location[2] = loc.Z();
......@@ -112,20 +111,20 @@ Array<OneD, NekDouble> CADSurf::P(Array<OneD, NekDouble> uv)
/**
* @brief Get the normal vector at parametric point u,v.
*
* @param uv array of u and v parametric coords
* @return array oc xyz components of normal vector
* @param uv Array of u and v parametric coords.
* @return Array of xyz components of normal vector.
*/
Array<OneD, NekDouble> CADSurf::N(Array<OneD, NekDouble> uv)
{
Array<OneD, NekDouble> normal(3);
gp_Pnt Loc;
gp_Vec D1U, D1V;
occSurface.D1(uv[0], uv[1], Loc, D1U, D1V);
m_occSurface.D1(uv[0], uv[1], Loc, D1U, D1V);
gp_Vec n = D1U.Crossed(D1V);
if(n.X() == 0 && n.Y() == 0 && n.Z() == 0)
if (n.X() == 0 && n.Y() == 0 && n.Z() == 0)
{
//return bad normal
// Return bad normal
normal[0] = 0.0;
normal[1] = 0.0;
normal[2] = 0.0;
......@@ -144,8 +143,8 @@ Array<OneD, NekDouble> CADSurf::N(Array<OneD, NekDouble> uv)
/**
* @brief Get the set of first derivatives at parametric point u,v
*
* @param uv array of u and v parametric coords
* @return array of xyz copmonents of first derivatives
* @param uv Array of u and v parametric coords.
* @return Array of xyz copmonents of first derivatives.
*/
Array<OneD, NekDouble> CADSurf::D1(Array<OneD, NekDouble> uv)
......@@ -153,7 +152,7 @@ Array<OneD, NekDouble> CADSurf::D1(Array<OneD, NekDouble> uv)
Array<OneD, NekDouble> r(9);
gp_Pnt Loc;
gp_Vec D1U, D1V;
occSurface.D1(uv[0], uv[1], Loc, D1U, D1V);
m_occSurface.D1(uv[0], uv[1], Loc, D1U, D1V);
r[0] = Loc.X(); //x
r[1] = Loc.Y(); //y
......@@ -180,7 +179,7 @@ Array<OneD, NekDouble> CADSurf::D2(Array<OneD, NekDouble> uv)
Array<OneD, NekDouble> r(18);
gp_Pnt Loc;
gp_Vec D1U, D1V, D2U, D2V, D2UV;
occSurface.D2(uv[0], uv[1], Loc, D1U, D1V, D2U, D2V, D2UV);
m_occSurface.D2(uv[0], uv[1], Loc, D1U, D1V, D2U, D2V, D2UV);
r[0] = Loc.X(); //x
r[1] = Loc.Y(); //y
......
......@@ -29,11 +29,10 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: cad object surface.
// Description: CAD object surface.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef NEKTAR_LIB_UTILITIES_CADSYSTEM_CADSURF_H
#define NEKTAR_LIB_UTILITIES_CADSYSTEM_CADSURF_H
......@@ -54,64 +53,57 @@ class CADSurf
friend class MemoryManager<CADSurf>;
/**
* @brief Defualt constructor.
* @brief Default constructor.
*/
CADSurf(int i, TopoDS_Shape in,
std::vector<std::vector<std::pair<int,int> > > ein);
/**
* @brief Get the ids of the edges which bound the surface.
* @brief Get the IDs of the edges which bound the surface.
*
* The edges are organsised into two vectors which are grouped into
* the contisous loops of the bounding edges, then the edges which are
* a pair of ints, the first is the edge id and the second is an int
* which indicates whether this edge is orientated forwards or backwards
* on this surface to form the loop
* The edges are organsised into two vectors, which are grouped into the
* continuous loops of the bounding edges, then the edges, which are a
* pair of integers. The first item is the edge ID and the second is an
* integer that indicates whether this edge is orientated forwards or
* backwards on this surface to form the loop.
*/
std::vector<std::vector<std::pair<int,int> > > GetEdges()
{
return edges;
return m_edges;
}
Array<OneD, NekDouble> N(Array<OneD, NekDouble> uv);
Array<OneD, NekDouble> D1(Array<OneD, NekDouble> uv);
Array<OneD, NekDouble> D2(Array<OneD, NekDouble> uv);
Array<OneD, NekDouble> P(Array<OneD, NekDouble> uv);
Array<OneD, NekDouble> locuv(Array<OneD, NekDouble> p);
/**
* @brief Get the limits of the parametric space for the surface
* @brief Get the limits of the parametric space for the surface.
*
* @return array of 4 entries with parametric umin,umax,vmin,vmax
* @return Array of 4 entries with parametric umin,umax,vmin,vmax.
*/
Array<OneD, NekDouble> GetBounds()
{
Array<OneD,NekDouble> b(4);
b[0]=occSurface.FirstUParameter();
b[1]=occSurface.LastUParameter();
b[2]=occSurface.FirstVParameter();
b[3]=occSurface.LastVParameter();
b[0] = m_occSurface.FirstUParameter();
b[1] = m_occSurface.LastUParameter();
b[2] = m_occSurface.FirstVParameter();
b[3] = m_occSurface.LastVParameter();
return b;
}
private:
Array<OneD, NekDouble> N (Array<OneD, NekDouble> uv);
Array<OneD, NekDouble> D1 (Array<OneD, NekDouble> uv);
Array<OneD, NekDouble> D2 (Array<OneD, NekDouble> uv);
Array<OneD, NekDouble> P (Array<OneD, NekDouble> uv);
Array<OneD, NekDouble> locuv(Array<OneD, NekDouble> p);
///id of surface
int ID;
///opencascade object for surface
BRepAdaptor_Surface occSurface;
///alternate opencascade object for surface used by reverse lookup
Handle(Geom_Surface) s;
///list of bounding edges in loops with orientation
std::vector<std::vector<std::pair<int,int> > > edges;
private:
/// ID of surface.
int m_ID;
/// OpenCascade object for surface.
BRepAdaptor_Surface m_occSurface;
/// Alternate OpenCascade object for surface. Used by reverse lookup.
Handle(Geom_Surface) m_s;
/// List of bounding edges in loops with orientation.
std::vector<std::vector<std::pair<int,int> > > m_edges;
};
typedef boost::shared_ptr<CADSurf> CADSurfSharedPtr;
......
......@@ -43,9 +43,13 @@
#include <LibUtilities/CADSystem/CADSystem.h>
using namespace std;
namespace Nektar{
namespace LibUtilities{
namespace Nektar {
namespace LibUtilities {
/**
* @brief Return the name of the CAD system.
*/
string CADSystem::GetName()
{
return m_name;
......@@ -66,9 +70,9 @@ void CADSystem::Report()
* @brief Returns bounding box of the domain.
*
* Gets the bounding box of the domain by considering the start and end
* points of each curve in the geometry
* @return array with 6 entries xmin,xmax,ymin.....
* points of each curve in the geometry.
*
* @return Array with 6 entries: xmin, xmax, ymin, ymax, zmin and zmax.
*/
Array<OneD, NekDouble> CADSystem::GetBoundingBox()
{
......@@ -102,11 +106,11 @@ Array<OneD, NekDouble> CADSystem::GetBoundingBox()
/**
* @brief Initialises CAD and makes surface and curve maps.
*
* @return true if completed sucsessfully
* @return true if completed successfully
*/
bool CADSystem::LoadCAD()
{
if ( !boost::filesystem::exists( m_name.c_str() ) )
if (!boost::filesystem::exists(m_name.c_str()))
{
return false;
}
......@@ -117,10 +121,9 @@ bool CADSystem::LoadCAD()
TopoDS_Shape shape;
if(boost::iequals(ext,".STEP") == 0 ||
boost::iequals(ext,".STP") == 0 )
if (boost::iequals(ext,".STEP") || boost::iequals(ext,".STP"))
{
//takes step file and makes opencascade shape
// Takes step file and makes OpenCascade shape
STEPControl_Reader reader;
reader = STEPControl_Reader();
reader.ReadFile(m_name.c_str());
......@@ -132,10 +135,9 @@ bool CADSystem::LoadCAD()
return false;
}
}
else if(boost::iequals(ext,".IGES") == 0 ||
boost::iequals(ext,".IGS") == 0 )
else if(boost::iequals(ext,".IGES") || boost::iequals(ext,".IGS"))
{
//takes igs file and makes opencascade shape
// Takes IGES file and makes OpenCascade shape
IGESControl_Reader reader;
reader = IGESControl_Reader();
reader.ReadFile(m_name.c_str());
......@@ -152,27 +154,27 @@ bool CADSystem::LoadCAD()
return false;
}
//from opencascade maps Calculates Euler-Poincar number
// From OpenCascade maps calculate Euler-Poincare number.
TopTools_IndexedMapOfShape fc, vc, ec;
TopExp::MapShapes(shape,TopAbs_FACE,fc);
TopExp::MapShapes(shape,TopAbs_EDGE,ec);
TopExp::MapShapes(shape,TopAbs_VERTEX<