Commit 747113b6 authored by Dave Moxey's avatar Dave Moxey
Browse files

Minor cosmetic changes, remove unneeded enumeration

parent ec9c8981
......@@ -59,7 +59,9 @@ public:
*/
CADCurve(){};
~CADCurve(){};
~CADCurve()
{
}
/**
* @brief Returns the minimum and maximum parametric coords t of the curve.
......@@ -90,7 +92,7 @@ public:
/**
* @brief Gets the second derivatives at t
*/
virtual Array<OneD, NekDouble> D2(NekDouble t) = 0;
virtual Array<OneD, NekDouble> D2(NekDouble t) = 0;
/**
* @brief Calculates the parametric coordinate and arclength location
......@@ -162,7 +164,7 @@ protected:
typedef boost::shared_ptr<CADCurve> CADCurveSharedPtr;
typedef LibUtilities::NekFactory<EngineKey,CADCurve> CADCurveFactory;
typedef LibUtilities::NekFactory<std::string, CADCurve> CADCurveFactory;
CADCurveFactory& GetCADCurveFactory();
......
......@@ -60,9 +60,13 @@ public:
/**
* @brief Default constructor.
*/
CADSurf(){};
CADSurf()
{
}
~CADSurf(){};
~CADSurf()
{
}
/**
* @brief Get the loop structures which bound the cad surface
......@@ -158,15 +162,16 @@ public:
protected:
/// normal
bool m_correctNormal;
/// Function which tests the the value of uv used is within the surface
virtual void Test(Array<OneD, NekDouble> uv) = 0;
/// List of bounding edges in loops with orientation.
std::vector<EdgeLoop> m_edges;
/// Function which tests the the value of uv used is within the surface
virtual void Test(Array<OneD, NekDouble> uv) = 0;
};
typedef boost::shared_ptr<CADSurf> CADSurfSharedPtr;
typedef LibUtilities::NekFactory<EngineKey,CADSurf> CADSurfFactory;
typedef LibUtilities::NekFactory<std::string, CADSurf> CADSurfFactory;
CADSurfFactory& GetCADSurfFactory();
......
......@@ -33,10 +33,10 @@
//
////////////////////////////////////////////////////////////////////////////////
#include "CADSystem.h"
#include "CADVert.h"
#include "CADCurve.h"
#include "CADSurf.h"
#include <NekMeshUtils/CADSystem/CADSystem.h>
#include <NekMeshUtils/CADSystem/CADVert.h>
#include <NekMeshUtils/CADSystem/CADCurve.h>
#include <NekMeshUtils/CADSystem/CADSurf.h>
using namespace std;
......@@ -45,11 +45,6 @@ namespace Nektar
namespace NekMeshUtils
{
std::ostream& operator<<(std::ostream&os, const EngineKey& rhs)
{
return os << rhs.second;
}
EngineFactory& GetEngineFactory()
{
typedef Loki::SingletonHolder<EngineFactory, Loki::CreateUsingNew,
......
......@@ -82,9 +82,13 @@ public:
/**
* @brief Default constructor.
*/
CADSystem(std::string name) : m_name(name) {};
CADSystem(std::string name) : m_name(name)
{
}
~CADSystem(){};
~CADSystem()
{
}
/**
* @brief Return the name of the CAD system.
......@@ -187,16 +191,8 @@ protected:
};
typedef boost::shared_ptr<CADSystem> CADSystemSharedPtr;
enum EngineType{
eOCE,
eCFI
};
typedef std::pair<EngineType,std::string> EngineKey;
std::ostream& operator<<(std::ostream&os, const EngineKey& rhs);
typedef LibUtilities::NekFactory<EngineKey,CADSystem,std::string> EngineFactory;
typedef LibUtilities::NekFactory<std::string, CADSystem, std::string>
EngineFactory;
EngineFactory& GetEngineFactory();
......
......@@ -126,7 +126,7 @@ protected:
typedef boost::shared_ptr<CADVert> CADVertSharedPtr;
typedef LibUtilities::NekFactory<EngineKey,CADVert> CADVertFactory;
typedef LibUtilities::NekFactory<std::string, CADVert> CADVertFactory;
CADVertFactory& GetCADVertFactory();
......
......@@ -33,7 +33,7 @@
//
////////////////////////////////////////////////////////////////////////////////
#include "CADCurveOCE.h"
#include <NekMeshUtils/CADSystem/OCE/CADCurveOCE.h>
using namespace std;
......@@ -42,8 +42,8 @@ namespace Nektar
namespace NekMeshUtils
{
EngineKey CADCurveOCE::key = GetCADCurveFactory().RegisterCreatorFunction(
EngineKey(eOCE,"oce"),CADCurveOCE::create,"CADCurveOCE");
std::string CADCurveOCE::key = GetCADCurveFactory().RegisterCreatorFunction(
"oce", CADCurveOCE::create, "CADCurveOCE");
NekDouble CADCurveOCE::tAtArcLength(NekDouble s)
{
......
......@@ -36,8 +36,8 @@
#ifndef NEKMESHUTILS_CADSYSTEM_OCE_CADCURVEOCE
#define NEKMESHUTILS_CADSYSTEM_OCE_CADCURVEOCE
#include "../CADCurve.h"
#include "OpenCascade.h"
#include <NekMeshUtils/CADSystem/CADCurve.h>
#include <NekMeshUtils/CADSystem/OCE/OpenCascade.h>
namespace Nektar
{
......@@ -53,23 +53,22 @@ public:
return MemoryManager<CADCurveOCE>::AllocateSharedPtr();
}
static EngineKey key;
static std::string key;
CADCurveOCE(){};
~CADCurveOCE(){};
Array<OneD, NekDouble> Bounds();
NekDouble Length(NekDouble ti, NekDouble tf);
Array<OneD, NekDouble> P(NekDouble t);
Array<OneD, NekDouble> D2(NekDouble t);
CADCurveOCE()
{
}
NekDouble tAtArcLength(NekDouble s);
~CADCurveOCE()
{
}
Array<OneD, NekDouble> GetMinMax();
virtual Array<OneD, NekDouble> Bounds();
virtual NekDouble Length(NekDouble ti, NekDouble tf);
virtual Array<OneD, NekDouble> P(NekDouble t);
virtual Array<OneD, NekDouble> D2(NekDouble t);
virtual NekDouble tAtArcLength(NekDouble s);
virtual Array<OneD, NekDouble> GetMinMax();
void Initialise(int i, TopoDS_Shape in)
{
......
......@@ -33,7 +33,7 @@
//
////////////////////////////////////////////////////////////////////////////////
#include "CADSurfOCE.h"
#include <NekMeshUtils/CADSystem/OCE/CADSurfOCE.h>
using namespace std;
......@@ -42,8 +42,8 @@ namespace Nektar
namespace NekMeshUtils
{
EngineKey CADSurfOCE::key = GetCADSurfFactory().RegisterCreatorFunction(
EngineKey(eOCE,"oce"),CADSurfOCE::create,"CADSurfOCE");
std::string CADSurfOCE::key = GetCADSurfFactory().RegisterCreatorFunction(
"oce", CADSurfOCE::create, "CADSurfOCE");
void CADSurfOCE::Initialise(int i, TopoDS_Shape in, vector<EdgeLoop> ein)
{
......@@ -62,6 +62,18 @@ void CADSurfOCE::Initialise(int i, TopoDS_Shape in, vector<EdgeLoop> ein)
m_type = surf;
}
Array<OneD, NekDouble> CADSurfOCE::GetBounds()
{
Array<OneD,NekDouble> b(4);
b[0] = m_occSurface.FirstUParameter();
b[1] = m_occSurface.LastUParameter();
b[2] = m_occSurface.FirstVParameter();
b[3] = m_occSurface.LastVParameter();
return b;
}
Array<OneD, NekDouble> CADSurfOCE::locuv(Array<OneD, NekDouble> p)
{
// has to transfer back to mm
......
......@@ -36,9 +36,8 @@
#ifndef NekMeshUtils_CADSYSTEM_OCE_CADSURFOCE
#define NekMeshUtils_CADSYSTEM_OCE_CADSURFOCE
#include "../CADSurf.h"
#include "OpenCascade.h"
#include <NekMeshUtils/CADSystem/CADSurf.h>
#include <NekMeshUtils/CADSystem/OCE/OpenCascade.h>
namespace Nektar
{
......@@ -54,41 +53,28 @@ public:
return MemoryManager<CADSurfOCE>::AllocateSharedPtr();
}
static EngineKey key;
CADSurfOCE() {};
~CADSurfOCE(){};
void Initialise(int i, TopoDS_Shape in, std::vector<EdgeLoop> ein);
static std::string key;
Array<OneD, NekDouble> GetBounds()
CADSurfOCE()
{
Array<OneD,NekDouble> b(4);
b[0] = m_occSurface.FirstUParameter();
b[1] = m_occSurface.LastUParameter();
b[2] = m_occSurface.FirstVParameter();
b[3] = m_occSurface.LastVParameter();
return b;
}
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);
NekDouble DistanceTo(Array<OneD, NekDouble> p);
~CADSurfOCE()
{
}
void ProjectTo(Array<OneD, NekDouble> &tp, Array<OneD, NekDouble> &uv);
void Initialise(int i, TopoDS_Shape in, std::vector<EdgeLoop> ein);
NekDouble Curvature(Array<OneD, NekDouble> uv);
virtual Array<OneD, NekDouble> GetBounds();
virtual Array<OneD, NekDouble> N (Array<OneD, NekDouble> uv);
virtual Array<OneD, NekDouble> D1 (Array<OneD, NekDouble> uv);
virtual Array<OneD, NekDouble> D2 (Array<OneD, NekDouble> uv);
virtual Array<OneD, NekDouble> P (Array<OneD, NekDouble> uv);
virtual Array<OneD, NekDouble> locuv(Array<OneD, NekDouble> p);
virtual NekDouble DistanceTo(Array<OneD, NekDouble> p);
virtual void ProjectTo(Array<OneD, NekDouble> &tp,
Array<OneD, NekDouble> &uv);
virtual NekDouble Curvature(Array<OneD, NekDouble> uv);
private:
/// Function which tests the the value of uv used is within the surface
......
......@@ -33,11 +33,11 @@
//
////////////////////////////////////////////////////////////////////////////////
#include "CADSystemOCE.h"
#include "CADVertOCE.h"
#include "CADCurveOCE.h"
#include "CADSurfOCE.h"
#include "../CADCurve.h"
#include <NekMeshUtils/CADSystem/OCE/CADSystemOCE.h>
#include <NekMeshUtils/CADSystem/OCE/CADVertOCE.h>
#include <NekMeshUtils/CADSystem/OCE/CADCurveOCE.h>
#include <NekMeshUtils/CADSystem/OCE/CADSurfOCE.h>
#include <NekMeshUtils/CADSystem/CADSurf.h>
using namespace std;
......@@ -46,8 +46,8 @@ namespace Nektar
namespace NekMeshUtils
{
EngineKey CADSystemOCE::key = GetEngineFactory().RegisterCreatorFunction(
EngineKey(eOCE,"oce"),CADSystemOCE::create,"Uses OCE as cad engine");
std::string CADSystemOCE::key = GetEngineFactory().RegisterCreatorFunction(
"oce", CADSystemOCE::create, "Uses OCE as cad engine");
bool CADSystemOCE::LoadCAD()
{
......
......@@ -36,9 +36,8 @@
#ifndef NekMeshUtils_CADSYSTEM_OCE_CADSYSTEMOCE
#define NekMeshUtils_CADSYSTEM_OCE_CADSYSTEMOCE
#include "../CADSystem.h"
#include "OpenCascade.h"
#include <NekMeshUtils/CADSystem/CADSystem.h>
#include <NekMeshUtils/CADSystem/OCE/OpenCascade.h>
namespace Nektar
{
......@@ -54,7 +53,7 @@ public:
return MemoryManager<CADSystemOCE>::AllocateSharedPtr(name);
}
static EngineKey key;
static std::string key;
/**
* @brief Default constructor.
......
......@@ -33,8 +33,8 @@
//
////////////////////////////////////////////////////////////////////////////////
#include "CADSystemOCE.h"
#include "CADVertOCE.h"
#include <NekMeshUtils/CADSystem/OCE/CADSystemOCE.h>
#include <NekMeshUtils/CADSystem/OCE/CADVertOCE.h>
using namespace std;
......@@ -43,8 +43,8 @@ namespace Nektar
namespace NekMeshUtils
{
EngineKey CADVertOCE::key = GetCADVertFactory().RegisterCreatorFunction(
EngineKey(eOCE,"oce"),CADVertOCE::create,"CAD vert oce");
std::string CADVertOCE::key = GetCADVertFactory().RegisterCreatorFunction(
"oce", CADVertOCE::create, "CAD vert oce");
void CADVertOCE::Initialise(int i, TopoDS_Shape in)
{
......
......@@ -36,10 +36,8 @@
#ifndef NEKMESHUTILS_CADSYSTEM_OCE_CADVERTOCE
#define NEKMESHUTILS_CADSYSTEM_OCE_CADVERTOCE
#include "../CADVert.h"
#include <NekMeshUtils/MeshElements/Node.h>
#include "OpenCascade.h"
#include <NekMeshUtils/CADSystem/CADVert.h>
#include <NekMeshUtils/CADSystem/OCE/OpenCascade.h>
namespace Nektar
{
......@@ -55,17 +53,18 @@ public:
return MemoryManager<CADVertOCE>::AllocateSharedPtr();
}
static EngineKey key;
static std::string key;
/**
* @brief Default constructor.
*/
CADVertOCE()
{
}
~CADVertOCE(){};
~CADVertOCE()
{
}
void Initialise(int i, TopoDS_Shape in);
......
......@@ -122,7 +122,7 @@ void InputCAD::Process()
if(boost::iequals(tmp1.back(), "STEP") || boost::iequals(tmp1.back(), "STP"))
{
m_cad = GetEngineFactory().CreateInstance(EngineKey(eOCE,"oce"),m_CADName);
m_cad = GetEngineFactory().CreateInstance("oce", m_CADName);
}
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment