Remove Opencascade dependencies

This commit is contained in:
jrt 2003-09-03 17:29:04 +00:00
parent 355ad71d20
commit 13b8c20dfc
19 changed files with 341 additions and 945 deletions

View File

@ -25,8 +25,7 @@
// Author : Jean-Michel BOULCOURT // Author : Jean-Michel BOULCOURT
// Module : SMESH // Module : SMESH
using namespace std; #include "SMDS_EdgePosition.hxx"
#include "SMDS_EdgePosition.ixx"
#include "utilities.h" #include "utilities.h"
//======================================================================= //=======================================================================
@ -34,19 +33,8 @@ using namespace std;
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_EdgePosition::SMDS_EdgePosition() SMDS_EdgePosition::SMDS_EdgePosition(const int aEdgeId,
:SMDS_Position(0,SMDS_TOP_EDGE),myUParameter(0.) const double aUParam):SMDS_Position(aEdgeId), myUParameter(aUParam)
{
}
//=======================================================================
//function : SMDS_EdgePosition
//purpose :
//=======================================================================
SMDS_EdgePosition::SMDS_EdgePosition(const Standard_Integer aEdgeId,
const Standard_Real aUParam)
:SMDS_Position(aEdgeId,SMDS_TOP_EDGE),myUParameter(aUParam)
{ {
} }
@ -55,8 +43,31 @@ SMDS_EdgePosition::SMDS_EdgePosition(const Standard_Integer aEdgeId,
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pnt SMDS_EdgePosition::Coords() const const double *SMDS_EdgePosition::Coords() const
{ {
MESSAGE( "SMDS_EdgePosition::Coords not implemented" ); static double origin[]={0,0,0};
return gp_Pnt(0,0,0); MESSAGE("SMDS_EdgePosition::Coords not implemented");
return origin;
}
/**
*/
SMDS_TypeOfPosition SMDS_EdgePosition::GetTypeOfPosition() const
{
return SMDS_TOP_EDGE;
}
void SMDS_EdgePosition::SetUParameter(double aUparam)
{
myUParameter = aUparam;
}
//=======================================================================
//function : GetUParameter
//purpose :
//=======================================================================
double SMDS_EdgePosition::GetUParameter() const
{
return myUParameter;
} }

View File

@ -27,93 +27,23 @@
#ifndef _SMDS_EdgePosition_HeaderFile #ifndef _SMDS_EdgePosition_HeaderFile
#define _SMDS_EdgePosition_HeaderFile #define _SMDS_EdgePosition_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_SMDS_EdgePosition_HeaderFile
#include "Handle_SMDS_EdgePosition.hxx"
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _SMDS_Position_HeaderFile
#include "SMDS_Position.hxx" #include "SMDS_Position.hxx"
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
class gp_Pnt;
class SMDS_EdgePosition:public SMDS_Position
{
class SMDS_EdgePosition : public SMDS_Position { public:
SMDS_EdgePosition(const int aEdgeId=0, const double aUParam=0);
const virtual double * Coords() const;
SMDS_TypeOfPosition GetTypeOfPosition() const;
void SetUParameter(double aUparam);
double GetUParameter() const;
~SMDS_EdgePosition();
public: private:
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT SMDS_EdgePosition();
Standard_EXPORT SMDS_EdgePosition(const Standard_Integer aEdgeId,const Standard_Real aUParam);
Standard_EXPORT virtual gp_Pnt Coords() const;
Standard_EXPORT inline void SetUParameter(const Standard_Real aUparam) ;
Standard_EXPORT inline Standard_Real GetUParameter() const;
Standard_EXPORT ~SMDS_EdgePosition();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& SMDS_EdgePosition_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
Standard_Real myUParameter;
double myUParameter;
}; };
#include "SMDS_EdgePosition.lxx"
// other inline functions and methods (like "C++: function call" methods)
//
#endif #endif

View File

@ -25,8 +25,7 @@
// Author : Jean-Michel BOULCOURT // Author : Jean-Michel BOULCOURT
// Module : SMESH // Module : SMESH
using namespace std; #include "SMDS_FacePosition.hxx"
#include "SMDS_FacePosition.ixx"
#include "utilities.h" #include "utilities.h"
//======================================================================= //=======================================================================
@ -34,20 +33,10 @@ using namespace std;
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_FacePosition::SMDS_FacePosition() SMDS_FacePosition::SMDS_FacePosition(const int aEdgeId,
:SMDS_Position(0,SMDS_TOP_FACE),myUParameter(0.),myVParameter(0.) const double aUParam,
{ const double aVParam)
} :SMDS_Position(aEdgeId),
//=======================================================================
//function : SMDS_FacePosition
//purpose :
//=======================================================================
SMDS_FacePosition::SMDS_FacePosition(const Standard_Integer aEdgeId,
const Standard_Real aUParam,
const Standard_Real aVParam)
:SMDS_Position(aEdgeId,SMDS_TOP_FACE),
myUParameter(aUParam),myVParameter(aVParam) myUParameter(aUParam),myVParameter(aVParam)
{ {
} }
@ -56,9 +45,51 @@ SMDS_FacePosition::SMDS_FacePosition(const Standard_Integer aEdgeId,
//function : Coords //function : Coords
//purpose : //purpose :
//======================================================================= //=======================================================================
const double *SMDS_FacePosition::Coords() const
gp_Pnt SMDS_FacePosition::Coords() const
{ {
MESSAGE( "SMDS_FacePosition::Coords not implemented" ); static double origin[]={0,0,0};
return gp_Pnt(0,0,0); MESSAGE("SMDS_EdgePosition::Coords not implemented");
return origin;
}
/**
*/
SMDS_TypeOfPosition SMDS_FacePosition::GetTypeOfPosition() const
{
return SMDS_TOP_FACE;
}
void SMDS_FacePosition::SetUParameter(double aUparam)
{
myUParameter = aUparam;
}
//=======================================================================
//function : SetVParameter
//purpose :
//=======================================================================
void SMDS_FacePosition::SetVParameter(double aVparam)
{
myVParameter = aVparam;
}
//=======================================================================
//function : GetUParameter
//purpose :
//=======================================================================
double SMDS_FacePosition::GetUParameter() const
{
return myUParameter;
}
//=======================================================================
//function : GetVParameter
//purpose :
//=======================================================================
double SMDS_FacePosition::GetVParameter() const
{
return myVParameter;
} }

View File

@ -27,96 +27,23 @@
#ifndef _SMDS_FacePosition_HeaderFile #ifndef _SMDS_FacePosition_HeaderFile
#define _SMDS_FacePosition_HeaderFile #define _SMDS_FacePosition_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_SMDS_FacePosition_HeaderFile
#include "Handle_SMDS_FacePosition.hxx"
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _SMDS_Position_HeaderFile
#include "SMDS_Position.hxx" #include "SMDS_Position.hxx"
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
class gp_Pnt;
class SMDS_FacePosition:public SMDS_Position
{
class SMDS_FacePosition : public SMDS_Position { public:
SMDS_FacePosition(int aFaceId=0, double aUParam=0,
public: double aVParam=0);
const virtual double * Coords() const;
inline void* operator new(size_t,void* anAddress) SMDS_TypeOfPosition GetTypeOfPosition() const;
{ void SetUParameter(double aUparam);
return anAddress; void SetVParameter(double aVparam);
} double GetUParameter() const;
inline void* operator new(size_t size) double GetVParameter() const;
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT SMDS_FacePosition();
Standard_EXPORT SMDS_FacePosition(const Standard_Integer aFaceId,const Standard_Real aUParam,const Standard_Real aVParam);
Standard_EXPORT virtual gp_Pnt Coords() const;
Standard_EXPORT inline void SetUParameter(const Standard_Real aUparam) ;
Standard_EXPORT inline void SetVParameter(const Standard_Real aVparam) ;
Standard_EXPORT inline Standard_Real GetUParameter() const;
Standard_EXPORT inline Standard_Real GetVParameter() const;
Standard_EXPORT ~SMDS_FacePosition();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& SMDS_FacePosition_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
Standard_Real myUParameter;
Standard_Real myVParameter;
private:
double myUParameter;
double myVParameter;
}; };
#include "SMDS_FacePosition.lxx"
// other inline functions and methods (like "C++: function call" methods)
//
#endif #endif

View File

@ -25,15 +25,36 @@
// Author : Jean-Michel BOULCOURT // Author : Jean-Michel BOULCOURT
// Module : SMESH // Module : SMESH
using namespace std;
#include "SMDS_MeshElementIDFactory.ixx" #include "SMDS_MeshElementIDFactory.hxx"
#include "SMDS_MeshElement.hxx"
//======================================================================= //=======================================================================
//function : SMDS_MeshElementIDFactory //function : SMDS_MeshElementIDFactory
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshElementIDFactory::SMDS_MeshElementIDFactory():SMDS_MeshIDFactory()
SMDS_MeshElementIDFactory::SMDS_MeshElementIDFactory() : SMDS_MeshIDFactory()
{ {
} }
//=======================================================================
//function : BindID
//purpose :
//=======================================================================
bool SMDS_MeshElementIDFactory::BindID(int ID, SMDS_MeshElement * elem)
{
bool bound=myIDElements.insert(
map<int, SMDS_MeshElement*>::value_type(ID,elem)).second;
if(bound) elem->myID=ID;
return bound;
}
//=======================================================================
//function : MeshElement
//purpose :
//=======================================================================
SMDS_MeshElement* SMDS_MeshElementIDFactory::MeshElement(int ID)
{
map<int, SMDS_MeshElement*>::iterator it=myIDElements.find(ID);
if(it==myIDElements.end()) return NULL; else return (*it).second;
}

View File

@ -27,99 +27,23 @@
#ifndef _SMDS_MeshElementIDFactory_HeaderFile #ifndef _SMDS_MeshElementIDFactory_HeaderFile
#define _SMDS_MeshElementIDFactory_HeaderFile #define _SMDS_MeshElementIDFactory_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_SMDS_MeshElementIDFactory_HeaderFile
#include "Handle_SMDS_MeshElementIDFactory.hxx"
#endif
#ifndef _SMDS_DataMapOfIntegerMeshElement_HeaderFile
#include "SMDS_DataMapOfIntegerMeshElement.hxx"
#endif
#ifndef _SMDS_MeshIDFactory_HeaderFile
#include "SMDS_MeshIDFactory.hxx" #include "SMDS_MeshIDFactory.hxx"
#endif #include <SMDS_Iterator.hxx>
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx> #include <map>
#endif using namespace std;
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_SMDS_MeshElement_HeaderFile
#include "Handle_SMDS_MeshElement.hxx"
#endif
class SMDS_MeshElement; class SMDS_MeshElement;
class SMDS_MeshElementIDFactory:public SMDS_MeshIDFactory
class SMDS_MeshElementIDFactory : public SMDS_MeshIDFactory { {
public:
public: SMDS_MeshElementIDFactory();
bool BindID(int ID, SMDS_MeshElement * elem);
inline void* operator new(size_t,void* anAddress) SMDS_MeshElement * MeshElement(int ID);
{ private:
return anAddress; map<int, SMDS_MeshElement *> myIDElements;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT SMDS_MeshElementIDFactory();
Standard_EXPORT inline Standard_Integer GetFreeID() ;
Standard_EXPORT inline void ReleaseID(const Standard_Integer ID) ;
Standard_EXPORT inline Standard_Boolean BindID(const Standard_Integer ID,const Handle(SMDS_MeshElement)& elem) ;
Standard_EXPORT inline Handle_SMDS_MeshElement MeshElement(const Standard_Integer ID) const;
Standard_EXPORT ~SMDS_MeshElementIDFactory();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& SMDS_MeshElementIDFactory_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
SMDS_DataMapOfIntegerMeshElement myIDElements;
}; };
#include "SMDS_MeshElementIDFactory.lxx"
// other inline functions and methods (like "C++: function call" methods)
//
#endif #endif

View File

@ -25,16 +25,15 @@
// Module : SMESH // Module : SMESH
using namespace std; using namespace std;
#include "SMDS_MeshGroup.ixx" #include "SMDS_MeshGroup.hxx"
#include "SMDS_ListIteratorOfListOfMeshGroup.hxx" #include "utilities.h"
//======================================================================= //=======================================================================
//function : SMDS_MeshGroup //function : SMDS_MeshGroup
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshGroup::SMDS_MeshGroup(const Handle(SMDS_Mesh)& aMesh) SMDS_MeshGroup::SMDS_MeshGroup(const SMDS_Mesh * aMesh)
:myMesh(aMesh),myType(SMDSAbs_All) :myMesh(aMesh),myType(SMDSAbs_All), myParent(NULL)
{ {
} }
@ -43,8 +42,8 @@ SMDS_MeshGroup::SMDS_MeshGroup(const Handle(SMDS_Mesh)& aMesh)
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshGroup::SMDS_MeshGroup(const Handle(SMDS_MeshGroup)& parent) SMDS_MeshGroup::SMDS_MeshGroup(SMDS_MeshGroup * parent)
:myMesh(parent->myMesh),myType(SMDSAbs_All),myParent(parent) :myMesh(parent->myMesh),myType(SMDSAbs_All), myParent(parent)
{ {
} }
@ -53,13 +52,11 @@ SMDS_MeshGroup::SMDS_MeshGroup(const Handle(SMDS_MeshGroup)& parent)
//purpose : //purpose :
//======================================================================= //=======================================================================
Handle(SMDS_MeshGroup) SMDS_MeshGroup::AddSubGroup() const SMDS_MeshGroup *SMDS_MeshGroup::AddSubGroup()
{ {
Handle(SMDS_MeshGroup) subgroup = new SMDS_MeshGroup(this); const SMDS_MeshGroup * subgroup = new SMDS_MeshGroup(this);
if (!subgroup.IsNull()) { myChildren.insert(myChildren.end(),subgroup);
myChildren.Append(subgroup); return subgroup;
}
return subgroup;
} }
//======================================================================= //=======================================================================
@ -67,21 +64,21 @@ Handle(SMDS_MeshGroup) SMDS_MeshGroup::AddSubGroup()
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean SMDS_MeshGroup::RemoveSubGroup(const Handle(SMDS_MeshGroup)& aGroup) bool SMDS_MeshGroup::RemoveSubGroup(const SMDS_MeshGroup * aGroup)
{ {
Standard_Boolean found = Standard_False; bool found = false;
list<const SMDS_MeshGroup*>::iterator itgroup;
for(itgroup=myChildren.begin(); itgroup!=myChildren.end(); itgroup++)
{
const SMDS_MeshGroup* subgroup=*itgroup;
if (subgroup == aGroup)
{
found = true;
myChildren.erase(itgroup);
}
}
SMDS_ListIteratorOfListOfMeshGroup itgroup(myChildren); return found;
for (;itgroup.More() && !found; itgroup.Next()) {
Handle(SMDS_MeshGroup) subgroup;
subgroup = itgroup.Value();
if (subgroup == aGroup) {
found = Standard_True;
myChildren.Remove(itgroup);
}
}
return found;
} }
//======================================================================= //=======================================================================
@ -89,15 +86,15 @@ Standard_Boolean SMDS_MeshGroup::RemoveSubGroup(const Handle(SMDS_MeshGroup)& aG
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean SMDS_MeshGroup::RemoveFromParent() bool SMDS_MeshGroup::RemoveFromParent()
{ {
if (myParent.IsNull())
return Standard_False; if (myParent==NULL) return false;
else
return (myParent->RemoveSubGroup(this)); {
return (myParent->RemoveSubGroup(this));
}
} }
//======================================================================= //=======================================================================
//function : Clear //function : Clear
//purpose : //purpose :
@ -105,8 +102,8 @@ Standard_Boolean SMDS_MeshGroup::RemoveFromParent()
void SMDS_MeshGroup::Clear() void SMDS_MeshGroup::Clear()
{ {
myElements.Clear(); myElements.clear();
myType = SMDSAbs_All; myType = SMDSAbs_All;
} }
//======================================================================= //=======================================================================
@ -114,9 +111,9 @@ void SMDS_MeshGroup::Clear()
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean SMDS_MeshGroup::IsEmpty() const bool SMDS_MeshGroup::IsEmpty() const
{ {
return myElements.IsEmpty(); return myElements.empty();
} }
//======================================================================= //=======================================================================
@ -124,9 +121,9 @@ Standard_Boolean SMDS_MeshGroup::IsEmpty() const
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Integer SMDS_MeshGroup::Extent() const int SMDS_MeshGroup::Extent() const
{ {
return myElements.Extent(); return myElements.size();
} }
//======================================================================= //=======================================================================
@ -134,31 +131,25 @@ Standard_Integer SMDS_MeshGroup::Extent() const
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMDS_MeshGroup::Add(const Handle(SMDS_MeshElement)& ME) void SMDS_MeshGroup::Add(const SMDS_MeshElement * ME)
{ {
// the type of the group is determined by the first element added // the type of the group is determined by the first element added
if (myElements.IsEmpty()) { if (myElements.empty()) myType = ME->GetType();
myType = ME->GetType(); else if (ME->GetType() != myType)
} MESSAGE("SMDS_MeshGroup::Add : Type Mismatch");
if (ME->GetType() != myType) { myElements.insert(ME);
Standard_TypeMismatch::Raise("SMDS_MeshGroup::Add");
}
myElements.Add(ME);
} }
//======================================================================= //=======================================================================
//function : Remove //function : Remove
//purpose : //purpose :
//======================================================================= //=======================================================================
void SMDS_MeshGroup::Remove(const Handle(SMDS_MeshElement)& ME) void SMDS_MeshGroup::Remove(const SMDS_MeshElement * ME)
{ {
myElements.Remove(ME); myElements.erase(ME);
if (myElements.IsEmpty()) if (myElements.empty()) myType = SMDSAbs_All;
myType = SMDSAbs_All;
} }
//======================================================================= //=======================================================================
@ -168,7 +159,7 @@ void SMDS_MeshGroup::Remove(const Handle(SMDS_MeshElement)& ME)
SMDSAbs_ElementType SMDS_MeshGroup::Type() const SMDSAbs_ElementType SMDS_MeshGroup::Type() const
{ {
return myType; return myType;
} }
//======================================================================= //=======================================================================
@ -176,7 +167,7 @@ SMDSAbs_ElementType SMDS_MeshGroup::Type() const
//purpose : //purpose :
//======================================================================= //=======================================================================
Standard_Boolean SMDS_MeshGroup::Contains(const Handle(SMDS_MeshElement)& ME) const bool SMDS_MeshGroup::Contains(const SMDS_MeshElement * ME) const
{ {
return myElements.Contains(ME); return myElements.find(ME)!=myElements.end();
} }

View File

@ -26,127 +26,32 @@
#ifndef _SMDS_MeshGroup_HeaderFile #ifndef _SMDS_MeshGroup_HeaderFile
#define _SMDS_MeshGroup_HeaderFile #define _SMDS_MeshGroup_HeaderFile
#ifndef _Standard_HeaderFile #include "SMDS_Mesh.hxx"
#include <Standard.hxx> #include <set>
#endif using namespace std;
#ifndef _Handle_SMDS_MeshGroup_HeaderFile
#include "Handle_SMDS_MeshGroup.hxx"
#endif
#ifndef _Handle_SMDS_Mesh_HeaderFile
#include "Handle_SMDS_Mesh.hxx"
#endif
#ifndef _SMDSAbs_ElementType_HeaderFile
#include "SMDSAbs_ElementType.hxx"
#endif
#ifndef _SMDS_MapOfMeshElement_HeaderFile
#include "SMDS_MapOfMeshElement.hxx"
#endif
#ifndef _Handle_SMDS_MeshGroup_HeaderFile
#include "Handle_SMDS_MeshGroup.hxx"
#endif
#ifndef _SMDS_ListOfMeshGroup_HeaderFile
#include "SMDS_ListOfMeshGroup.hxx"
#endif
#ifndef _SMDS_MeshObject_HeaderFile
#include "SMDS_MeshObject.hxx"
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_SMDS_MeshElement_HeaderFile
#include "Handle_SMDS_MeshElement.hxx"
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
class SMDS_Mesh;
class Standard_NoSuchObject;
class Standard_TypeMismatch;
class SMDS_MeshElement;
class SMDS_MapOfMeshElement;
class SMDS_MeshGroup : public SMDS_MeshObject {
public:
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT SMDS_MeshGroup(const Handle(SMDS_Mesh)& aMesh);
Standard_EXPORT Handle_SMDS_MeshGroup AddSubGroup() ;
Standard_EXPORT virtual Standard_Boolean RemoveSubGroup(const Handle(SMDS_MeshGroup)& aGroup) ;
Standard_EXPORT virtual Standard_Boolean RemoveFromParent() ;
Standard_EXPORT void Clear() ;
Standard_EXPORT void Add(const Handle(SMDS_MeshElement)& ME) ;
Standard_EXPORT void Remove(const Handle(SMDS_MeshElement)& ME) ;
Standard_EXPORT Standard_Boolean IsEmpty() const;
Standard_EXPORT Standard_Integer Extent() const;
Standard_EXPORT SMDSAbs_ElementType Type() const;
Standard_EXPORT Standard_Boolean Contains(const Handle(SMDS_MeshElement)& ME) const;
Standard_EXPORT inline const SMDS_MapOfMeshElement& Elements() const;
Standard_EXPORT ~SMDS_MeshGroup();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& SMDS_MeshGroup_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
Standard_EXPORT SMDS_MeshGroup(const Handle(SMDS_MeshGroup)& parent);
// Fields PRIVATE
//
Handle_SMDS_Mesh myMesh;
SMDSAbs_ElementType myType;
SMDS_MapOfMeshElement myElements;
Handle_SMDS_MeshGroup myParent;
SMDS_ListOfMeshGroup myChildren;
class SMDS_MeshGroup:public SMDS_MeshObject
{
public:
SMDS_MeshGroup(const SMDS_Mesh * aMesh);
const SMDS_MeshGroup * AddSubGroup();
virtual bool RemoveSubGroup(const SMDS_MeshGroup* aGroup);
virtual bool RemoveFromParent();
void Clear();
void Add(const SMDS_MeshElement * ME);
void Remove(const SMDS_MeshElement * ME);
bool IsEmpty() const;
int Extent() const;
SMDSAbs_ElementType Type() const;
bool Contains(const SMDS_MeshElement * ME) const;
~SMDS_MeshGroup();
private:
SMDS_MeshGroup(SMDS_MeshGroup* parent);
const SMDS_Mesh *myMesh;
SMDSAbs_ElementType myType;
set<const SMDS_MeshElement *> myElements;
SMDS_MeshGroup * myParent;
list<const SMDS_MeshGroup*> myChildren;
}; };
#include "SMDS_MeshGroup.lxx"
// other inline functions and methods (like "C++: function call" methods)
//
#endif #endif

View File

@ -25,16 +25,34 @@
// Author : Jean-Michel BOULCOURT // Author : Jean-Michel BOULCOURT
// Module : SMESH // Module : SMESH
using namespace std;
#include "SMDS_MeshIDFactory.ixx"
#include "SMDS_MeshIDFactory.hxx"
//======================================================================= //=======================================================================
//function : SMDS_MeshIDFactory //function : SMDS_MeshIDFactory
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_MeshIDFactory::SMDS_MeshIDFactory() : myMaxID(0) SMDS_MeshIDFactory::SMDS_MeshIDFactory():myMaxID(0)
{ {
} }
int SMDS_MeshIDFactory::GetFreeID()
{
if (myPoolOfID.empty()) return ++myMaxID;
else
{
int ID = myPoolOfID.top();
myPoolOfID.pop();
return ID;
}
}
//=======================================================================
//function : ReleaseID
//purpose :
//=======================================================================
void SMDS_MeshIDFactory::ReleaseID(const int ID)
{
if (ID < myMaxID) myPoolOfID.push(ID);
}

View File

@ -27,90 +27,20 @@
#ifndef _SMDS_MeshIDFactory_HeaderFile #ifndef _SMDS_MeshIDFactory_HeaderFile
#define _SMDS_MeshIDFactory_HeaderFile #define _SMDS_MeshIDFactory_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_SMDS_MeshIDFactory_HeaderFile
#include "Handle_SMDS_MeshIDFactory.hxx"
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _TColStd_StackOfInteger_HeaderFile
#include <TColStd_StackOfInteger.hxx>
#endif
#ifndef _SMDS_MeshObject_HeaderFile
#include "SMDS_MeshObject.hxx" #include "SMDS_MeshObject.hxx"
#endif #include <stack>
using namespace std;
class SMDS_MeshIDFactory : public SMDS_MeshObject {
public:
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT virtual Standard_Integer GetFreeID() = 0;
Standard_EXPORT virtual void ReleaseID(const Standard_Integer ID) = 0;
Standard_EXPORT ~SMDS_MeshIDFactory();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& SMDS_MeshIDFactory_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
Standard_EXPORT SMDS_MeshIDFactory();
// Fields PROTECTED
//
Standard_Integer myMaxID;
TColStd_StackOfInteger myPoolOfID;
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
class SMDS_MeshIDFactory:public SMDS_MeshObject
{
public:
virtual int GetFreeID();
virtual void ReleaseID(int ID);
protected:
SMDS_MeshIDFactory();
int myMaxID;
stack<int> myPoolOfID;
}; };
// other inline functions and methods (like "C++: function call" methods)
//
#endif #endif

View File

@ -25,5 +25,4 @@
// Author : Jean-Michel BOULCOURT // Author : Jean-Michel BOULCOURT
// Module : SMESH // Module : SMESH
using namespace std; #include "SMDS_MeshObject.hxx"
#include "SMDS_MeshObject.ixx"

View File

@ -27,79 +27,8 @@
#ifndef _SMDS_MeshObject_HeaderFile #ifndef _SMDS_MeshObject_HeaderFile
#define _SMDS_MeshObject_HeaderFile #define _SMDS_MeshObject_HeaderFile
#ifndef _Standard_HeaderFile class SMDS_MeshObject
#include <Standard.hxx> {
#endif public:
#ifndef _Handle_SMDS_MeshObject_HeaderFile
#include "Handle_SMDS_MeshObject.hxx"
#endif
#ifndef _MMgt_TShared_HeaderFile
#include <MMgt_TShared.hxx>
#endif
class SMDS_MeshObject : public MMgt_TShared {
public:
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT ~SMDS_MeshObject();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& SMDS_MeshObject_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
}; };
// other inline functions and methods (like "C++: function call" methods)
//
#endif #endif

View File

@ -25,16 +25,33 @@
// Author : Jean-Michel BOULCOURT // Author : Jean-Michel BOULCOURT
// Module : SMESH // Module : SMESH
using namespace std; #include "SMDS_Position.hxx"
#include "SMDS_Position.ixx"
//======================================================================= //=======================================================================
//function : SMDS_Position //function : SMDS_Position
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_Position::SMDS_Position(const Standard_Integer aShapeId, SMDS_Position::SMDS_Position(int aShapeId) :myShapeId(aShapeId)
const SMDS_TypeOfPosition aType)
:myShapeId(aShapeId),myType(aType)
{ {
} }
//=======================================================================
//function : SetShapeId
//purpose :
//=======================================================================
void SMDS_Position::SetShapeId(int aShapeId)
{
myShapeId = aShapeId;
}
//=======================================================================
//function : GetShapeId
//purpose :
//=======================================================================
int SMDS_Position::GetShapeId() const
{
return myShapeId;
}

View File

@ -27,94 +27,22 @@
#ifndef _SMDS_Position_HeaderFile #ifndef _SMDS_Position_HeaderFile
#define _SMDS_Position_HeaderFile #define _SMDS_Position_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_SMDS_Position_HeaderFile
#include "Handle_SMDS_Position.hxx"
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _SMDS_TypeOfPosition_HeaderFile
#include "SMDS_TypeOfPosition.hxx" #include "SMDS_TypeOfPosition.hxx"
#endif
#ifndef _MMgt_TShared_HeaderFile
#include <MMgt_TShared.hxx>
#endif
class gp_Pnt;
class SMDS_Position
{
class SMDS_Position : public MMgt_TShared { public:
const virtual double * Coords() const = 0;
public: virtual inline SMDS_TypeOfPosition GetTypeOfPosition() const = 0;
void SetShapeId(int aShapeId);
inline void* operator new(size_t,void* anAddress) int GetShapeId() const;
{ ~SMDS_Position();
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT virtual gp_Pnt Coords() const = 0;
Standard_EXPORT inline SMDS_TypeOfPosition GetTypeOfPosition() const;
Standard_EXPORT inline void SetShapeId(const Standard_Integer aShapeId) ;
Standard_EXPORT inline Standard_Integer GetShapeId() const;
Standard_EXPORT ~SMDS_Position();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& SMDS_Position_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
Standard_EXPORT SMDS_Position(const Standard_Integer aShapeId,const SMDS_TypeOfPosition aType = SMDS_TOP_UNSPEC);
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
Standard_Integer myShapeId;
SMDS_TypeOfPosition myType;
protected:
SMDS_Position(int aShapeId);
private:
int myShapeId;
}; };
#include "SMDS_Position.lxx"
// other inline functions and methods (like "C++: function call" methods)
//
#endif #endif

View File

@ -25,47 +25,35 @@
// Author : Jean-Michel BOULCOURT // Author : Jean-Michel BOULCOURT
// Module : SMESH // Module : SMESH
using namespace std; #include "SMDS_SpacePosition.hxx"
#include "SMDS_SpacePosition.ixx"
//======================================================================= //=======================================================================
//function : SMDS_SpacePosition //function : SMDS_SpacePosition
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_SpacePosition::SMDS_SpacePosition() SMDS_SpacePosition::SMDS_SpacePosition(double x, double y, double z):
:SMDS_Position(0,SMDS_TOP_3DSPACE),myCoords(0.,0.,0.) SMDS_Position(0)
{ {
myCoords[0]=x;
myCoords[1]=y;
myCoords[2]=z;
} }
//======================================================================= /**
//function : SMDS_SpacePosition */
//purpose : SMDS_TypeOfPosition SMDS_SpacePosition::GetTypeOfPosition() const
//=======================================================================
SMDS_SpacePosition::SMDS_SpacePosition(const Standard_Real x,
const Standard_Real y,
const Standard_Real z)
:SMDS_Position(0,SMDS_TOP_3DSPACE),myCoords(x,y,z)
{ {
return SMDS_TOP_3DSPACE;
} }
//======================================================================= const double * SMDS_SpacePosition::Coords() const
//function : SMDS_SpacePosition
//purpose :
//=======================================================================
SMDS_SpacePosition::SMDS_SpacePosition(const gp_Pnt& aCoords)
:SMDS_Position(0,SMDS_TOP_3DSPACE),myCoords(aCoords)
{ {
return myCoords;
} }
//======================================================================= SMDS_SpacePosition * SMDS_SpacePosition::originSpacePosition()
//function : Coords
//purpose :
//=======================================================================
gp_Pnt SMDS_SpacePosition::Coords() const
{ {
return myCoords; static SMDS_SpacePosition * staticpos=new SMDS_SpacePosition();
return staticpos;
} }

View File

@ -27,94 +27,20 @@
#ifndef _SMDS_SpacePosition_HeaderFile #ifndef _SMDS_SpacePosition_HeaderFile
#define _SMDS_SpacePosition_HeaderFile #define _SMDS_SpacePosition_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_SMDS_SpacePosition_HeaderFile
#include "Handle_SMDS_SpacePosition.hxx"
#endif
#ifndef _gp_Pnt_HeaderFile
#include <gp_Pnt.hxx>
#endif
#ifndef _SMDS_Position_HeaderFile
#include "SMDS_Position.hxx" #include "SMDS_Position.hxx"
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
class gp_Pnt;
class SMDS_SpacePosition : public SMDS_Position {
public:
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT SMDS_SpacePosition();
Standard_EXPORT SMDS_SpacePosition(const Standard_Real x,const Standard_Real y,const Standard_Real z);
Standard_EXPORT SMDS_SpacePosition(const gp_Pnt& aCoords);
Standard_EXPORT virtual gp_Pnt Coords() const;
Standard_EXPORT inline void SetCoords(const Standard_Real x,const Standard_Real y,const Standard_Real z) ;
Standard_EXPORT inline void SetCoords(const gp_Pnt& aCoords) ;
Standard_EXPORT ~SMDS_SpacePosition();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& SMDS_SpacePosition_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
gp_Pnt myCoords;
class SMDS_SpacePosition:public SMDS_Position
{
public:
SMDS_SpacePosition(double x=0, double y=0, double z=0);
const virtual double * Coords() const;
virtual inline SMDS_TypeOfPosition GetTypeOfPosition() const;
inline void SetCoords(const double x, const double y, const double z);
~SMDS_SpacePosition();
static SMDS_SpacePosition * originSpacePosition();
private:
double myCoords[3];
}; };
#include "SMDS_SpacePosition.lxx"
// other inline functions and methods (like "C++: function call" methods)
//
#endif #endif

View File

@ -27,17 +27,13 @@
#ifndef _SMDS_TypeOfPosition_HeaderFile #ifndef _SMDS_TypeOfPosition_HeaderFile
#define _SMDS_TypeOfPosition_HeaderFile #define _SMDS_TypeOfPosition_HeaderFile
enum SMDS_TypeOfPosition { enum SMDS_TypeOfPosition
SMDS_TOP_UNSPEC, {
SMDS_TOP_3DSPACE, SMDS_TOP_UNSPEC,
SMDS_TOP_VERTEX, SMDS_TOP_3DSPACE,
SMDS_TOP_EDGE, SMDS_TOP_VERTEX,
SMDS_TOP_FACE SMDS_TOP_EDGE,
SMDS_TOP_FACE
}; };
#ifndef _Standard_PrimitiveTypes_HeaderFile
#include <Standard_PrimitiveTypes.hxx>
#endif
#endif #endif

View File

@ -25,8 +25,7 @@
// Author : Jean-Michel BOULCOURT // Author : Jean-Michel BOULCOURT
// Module : SMESH // Module : SMESH
using namespace std; #include "SMDS_VertexPosition.hxx"
#include "SMDS_VertexPosition.ixx"
#include "utilities.h" #include "utilities.h"
//======================================================================= //=======================================================================
@ -34,29 +33,25 @@ using namespace std;
//purpose : //purpose :
//======================================================================= //=======================================================================
SMDS_VertexPosition::SMDS_VertexPosition() SMDS_VertexPosition:: SMDS_VertexPosition(const int aVertexId)
:SMDS_Position(0,SMDS_TOP_VERTEX) :SMDS_Position(aVertexId)
{ {
} }
//=======================================================================
//function : SMDS_VertexPosition
//purpose :
//=======================================================================
SMDS_VertexPosition::SMDS_VertexPosition(const Standard_Integer aVertexId)
:SMDS_Position(aVertexId,SMDS_TOP_VERTEX)
{
}
//======================================================================= //=======================================================================
//function : Coords //function : Coords
//purpose : //purpose :
//======================================================================= //=======================================================================
gp_Pnt SMDS_VertexPosition::Coords() const const double *SMDS_VertexPosition::Coords() const
{ {
MESSAGE( "SMDS_VertexPosition::Coords not implemented" ); const static double origin[]={0,0,0};
return gp_Pnt(0,0,0); MESSAGE("SMDS_EdgePosition::Coords not implemented");
return origin;
}
SMDS_TypeOfPosition SMDS_VertexPosition::GetTypeOfPosition() const
{
return SMDS_TOP_VERTEX;
} }

View File

@ -27,86 +27,16 @@
#ifndef _SMDS_VertexPosition_HeaderFile #ifndef _SMDS_VertexPosition_HeaderFile
#define _SMDS_VertexPosition_HeaderFile #define _SMDS_VertexPosition_HeaderFile
#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Handle_SMDS_VertexPosition_HeaderFile
#include "Handle_SMDS_VertexPosition.hxx"
#endif
#ifndef _SMDS_Position_HeaderFile
#include "SMDS_Position.hxx" #include "SMDS_Position.hxx"
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
class gp_Pnt;
class SMDS_VertexPosition : public SMDS_Position {
public:
inline void* operator new(size_t,void* anAddress)
{
return anAddress;
}
inline void* operator new(size_t size)
{
return Standard::Allocate(size);
}
inline void operator delete(void *anAddress)
{
if (anAddress) Standard::Free((Standard_Address&)anAddress);
}
// inline void operator delete(void *anAddress, size_t size)
// {
// if (anAddress) Standard::Free((Standard_Address&)anAddress,size);
// }
// Methods PUBLIC
//
Standard_EXPORT SMDS_VertexPosition();
Standard_EXPORT SMDS_VertexPosition(const Standard_Integer aVertexId);
Standard_EXPORT virtual gp_Pnt Coords() const;
Standard_EXPORT ~SMDS_VertexPosition();
// Type management
//
Standard_EXPORT friend Handle_Standard_Type& SMDS_VertexPosition_Type_();
Standard_EXPORT const Handle(Standard_Type)& DynamicType() const;
Standard_EXPORT Standard_Boolean IsKind(const Handle(Standard_Type)&) const;
protected:
// Methods PROTECTED
//
// Fields PROTECTED
//
private:
// Methods PRIVATE
//
// Fields PRIVATE
//
class SMDS_VertexPosition:public SMDS_Position
{
public:
SMDS_TypeOfPosition GetTypeOfPosition() const;
SMDS_VertexPosition(int aVertexId=0);
const double *Coords() const;
~SMDS_VertexPosition();
}; };
// other inline functions and methods (like "C++: function call" methods)
//
#endif #endif