mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-11 16:19:16 +05:00
Remove Opencascade dependencies
This commit is contained in:
parent
355ad71d20
commit
13b8c20dfc
@ -25,8 +25,7 @@
|
||||
// Author : Jean-Michel BOULCOURT
|
||||
// Module : SMESH
|
||||
|
||||
using namespace std;
|
||||
#include "SMDS_EdgePosition.ixx"
|
||||
#include "SMDS_EdgePosition.hxx"
|
||||
#include "utilities.h"
|
||||
|
||||
//=======================================================================
|
||||
@ -34,19 +33,8 @@ using namespace std;
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
SMDS_EdgePosition::SMDS_EdgePosition()
|
||||
:SMDS_Position(0,SMDS_TOP_EDGE),myUParameter(0.)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SMDS_EdgePosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
SMDS_EdgePosition::SMDS_EdgePosition(const Standard_Integer aEdgeId,
|
||||
const Standard_Real aUParam)
|
||||
:SMDS_Position(aEdgeId,SMDS_TOP_EDGE),myUParameter(aUParam)
|
||||
SMDS_EdgePosition::SMDS_EdgePosition(const int aEdgeId,
|
||||
const double aUParam):SMDS_Position(aEdgeId), myUParameter(aUParam)
|
||||
{
|
||||
}
|
||||
|
||||
@ -55,8 +43,31 @@ SMDS_EdgePosition::SMDS_EdgePosition(const Standard_Integer aEdgeId,
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt SMDS_EdgePosition::Coords() const
|
||||
const double *SMDS_EdgePosition::Coords() const
|
||||
{
|
||||
MESSAGE( "SMDS_EdgePosition::Coords not implemented" );
|
||||
return gp_Pnt(0,0,0);
|
||||
static double origin[]={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;
|
||||
}
|
||||
|
@ -27,93 +27,23 @@
|
||||
#ifndef _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"
|
||||
#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:
|
||||
|
||||
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;
|
||||
private:
|
||||
|
||||
double myUParameter;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include "SMDS_EdgePosition.lxx"
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -25,8 +25,7 @@
|
||||
// Author : Jean-Michel BOULCOURT
|
||||
// Module : SMESH
|
||||
|
||||
using namespace std;
|
||||
#include "SMDS_FacePosition.ixx"
|
||||
#include "SMDS_FacePosition.hxx"
|
||||
#include "utilities.h"
|
||||
|
||||
//=======================================================================
|
||||
@ -34,20 +33,10 @@ using namespace std;
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
SMDS_FacePosition::SMDS_FacePosition()
|
||||
:SMDS_Position(0,SMDS_TOP_FACE),myUParameter(0.),myVParameter(0.)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//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),
|
||||
SMDS_FacePosition::SMDS_FacePosition(const int aEdgeId,
|
||||
const double aUParam,
|
||||
const double aVParam)
|
||||
:SMDS_Position(aEdgeId),
|
||||
myUParameter(aUParam),myVParameter(aVParam)
|
||||
{
|
||||
}
|
||||
@ -56,9 +45,51 @@ SMDS_FacePosition::SMDS_FacePosition(const Standard_Integer aEdgeId,
|
||||
//function : Coords
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt SMDS_FacePosition::Coords() const
|
||||
const double *SMDS_FacePosition::Coords() const
|
||||
{
|
||||
MESSAGE( "SMDS_FacePosition::Coords not implemented" );
|
||||
return gp_Pnt(0,0,0);
|
||||
static double origin[]={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;
|
||||
}
|
||||
|
@ -27,96 +27,23 @@
|
||||
#ifndef _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"
|
||||
#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:
|
||||
|
||||
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_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;
|
||||
|
||||
public:
|
||||
SMDS_FacePosition(int aFaceId=0, double aUParam=0,
|
||||
double aVParam=0);
|
||||
const virtual double * Coords() const;
|
||||
SMDS_TypeOfPosition GetTypeOfPosition() const;
|
||||
void SetUParameter(double aUparam);
|
||||
void SetVParameter(double aVparam);
|
||||
double GetUParameter() const;
|
||||
double GetVParameter() const;
|
||||
|
||||
private:
|
||||
double myUParameter;
|
||||
double myVParameter;
|
||||
};
|
||||
|
||||
|
||||
#include "SMDS_FacePosition.lxx"
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -25,15 +25,36 @@
|
||||
// Author : Jean-Michel BOULCOURT
|
||||
// Module : SMESH
|
||||
|
||||
using namespace std;
|
||||
#include "SMDS_MeshElementIDFactory.ixx"
|
||||
|
||||
#include "SMDS_MeshElementIDFactory.hxx"
|
||||
#include "SMDS_MeshElement.hxx"
|
||||
|
||||
//=======================================================================
|
||||
//function : SMDS_MeshElementIDFactory
|
||||
//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;
|
||||
}
|
||||
|
@ -27,99 +27,23 @@
|
||||
#ifndef _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"
|
||||
#endif
|
||||
#ifndef _Standard_Integer_HeaderFile
|
||||
#include <Standard_Integer.hxx>
|
||||
#endif
|
||||
#ifndef _Standard_Boolean_HeaderFile
|
||||
#include <Standard_Boolean.hxx>
|
||||
#endif
|
||||
#ifndef _Handle_SMDS_MeshElement_HeaderFile
|
||||
#include "Handle_SMDS_MeshElement.hxx"
|
||||
#endif
|
||||
#include <SMDS_Iterator.hxx>
|
||||
|
||||
#include <map>
|
||||
using namespace std;
|
||||
|
||||
class SMDS_MeshElement;
|
||||
|
||||
|
||||
class SMDS_MeshElementIDFactory : public SMDS_MeshIDFactory {
|
||||
|
||||
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_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;
|
||||
|
||||
class SMDS_MeshElementIDFactory:public SMDS_MeshIDFactory
|
||||
{
|
||||
public:
|
||||
SMDS_MeshElementIDFactory();
|
||||
bool BindID(int ID, SMDS_MeshElement * elem);
|
||||
SMDS_MeshElement * MeshElement(int ID);
|
||||
private:
|
||||
map<int, SMDS_MeshElement *> myIDElements;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include "SMDS_MeshElementIDFactory.lxx"
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -25,16 +25,15 @@
|
||||
// Module : SMESH
|
||||
|
||||
using namespace std;
|
||||
#include "SMDS_MeshGroup.ixx"
|
||||
#include "SMDS_ListIteratorOfListOfMeshGroup.hxx"
|
||||
|
||||
#include "SMDS_MeshGroup.hxx"
|
||||
#include "utilities.h"
|
||||
//=======================================================================
|
||||
//function : SMDS_MeshGroup
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
SMDS_MeshGroup::SMDS_MeshGroup(const Handle(SMDS_Mesh)& aMesh)
|
||||
:myMesh(aMesh),myType(SMDSAbs_All)
|
||||
SMDS_MeshGroup::SMDS_MeshGroup(const SMDS_Mesh * aMesh)
|
||||
:myMesh(aMesh),myType(SMDSAbs_All), myParent(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
@ -43,8 +42,8 @@ SMDS_MeshGroup::SMDS_MeshGroup(const Handle(SMDS_Mesh)& aMesh)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
SMDS_MeshGroup::SMDS_MeshGroup(const Handle(SMDS_MeshGroup)& parent)
|
||||
:myMesh(parent->myMesh),myType(SMDSAbs_All),myParent(parent)
|
||||
SMDS_MeshGroup::SMDS_MeshGroup(SMDS_MeshGroup * parent)
|
||||
:myMesh(parent->myMesh),myType(SMDSAbs_All), myParent(parent)
|
||||
{
|
||||
}
|
||||
|
||||
@ -53,12 +52,10 @@ SMDS_MeshGroup::SMDS_MeshGroup(const Handle(SMDS_MeshGroup)& parent)
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(SMDS_MeshGroup) SMDS_MeshGroup::AddSubGroup()
|
||||
const SMDS_MeshGroup *SMDS_MeshGroup::AddSubGroup()
|
||||
{
|
||||
Handle(SMDS_MeshGroup) subgroup = new SMDS_MeshGroup(this);
|
||||
if (!subgroup.IsNull()) {
|
||||
myChildren.Append(subgroup);
|
||||
}
|
||||
const SMDS_MeshGroup * subgroup = new SMDS_MeshGroup(this);
|
||||
myChildren.insert(myChildren.end(),subgroup);
|
||||
return subgroup;
|
||||
}
|
||||
|
||||
@ -67,17 +64,17 @@ Handle(SMDS_MeshGroup) SMDS_MeshGroup::AddSubGroup()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean SMDS_MeshGroup::RemoveSubGroup(const Handle(SMDS_MeshGroup)& aGroup)
|
||||
bool SMDS_MeshGroup::RemoveSubGroup(const SMDS_MeshGroup * aGroup)
|
||||
{
|
||||
Standard_Boolean found = Standard_False;
|
||||
|
||||
SMDS_ListIteratorOfListOfMeshGroup itgroup(myChildren);
|
||||
for (;itgroup.More() && !found; itgroup.Next()) {
|
||||
Handle(SMDS_MeshGroup) subgroup;
|
||||
subgroup = itgroup.Value();
|
||||
if (subgroup == aGroup) {
|
||||
found = Standard_True;
|
||||
myChildren.Remove(itgroup);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,15 +86,15 @@ Standard_Boolean SMDS_MeshGroup::RemoveSubGroup(const Handle(SMDS_MeshGroup)& aG
|
||||
//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));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Clear
|
||||
//purpose :
|
||||
@ -105,7 +102,7 @@ Standard_Boolean SMDS_MeshGroup::RemoveFromParent()
|
||||
|
||||
void SMDS_MeshGroup::Clear()
|
||||
{
|
||||
myElements.Clear();
|
||||
myElements.clear();
|
||||
myType = SMDSAbs_All;
|
||||
}
|
||||
|
||||
@ -114,9 +111,9 @@ void SMDS_MeshGroup::Clear()
|
||||
//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 :
|
||||
//=======================================================================
|
||||
|
||||
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 :
|
||||
//=======================================================================
|
||||
|
||||
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
|
||||
if (myElements.IsEmpty()) {
|
||||
myType = ME->GetType();
|
||||
}
|
||||
if (myElements.empty()) myType = ME->GetType();
|
||||
else if (ME->GetType() != myType)
|
||||
MESSAGE("SMDS_MeshGroup::Add : Type Mismatch");
|
||||
|
||||
if (ME->GetType() != myType) {
|
||||
Standard_TypeMismatch::Raise("SMDS_MeshGroup::Add");
|
||||
}
|
||||
|
||||
myElements.Add(ME);
|
||||
myElements.insert(ME);
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Remove
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void SMDS_MeshGroup::Remove(const Handle(SMDS_MeshElement)& ME)
|
||||
void SMDS_MeshGroup::Remove(const SMDS_MeshElement * ME)
|
||||
{
|
||||
myElements.Remove(ME);
|
||||
if (myElements.IsEmpty())
|
||||
myType = SMDSAbs_All;
|
||||
myElements.erase(ME);
|
||||
if (myElements.empty()) myType = SMDSAbs_All;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@ -176,7 +167,7 @@ SMDSAbs_ElementType SMDS_MeshGroup::Type() const
|
||||
//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();
|
||||
}
|
||||
|
@ -26,127 +26,32 @@
|
||||
#ifndef _SMDS_MeshGroup_HeaderFile
|
||||
#define _SMDS_MeshGroup_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#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;
|
||||
#include "SMDS_Mesh.hxx"
|
||||
#include <set>
|
||||
using namespace std;
|
||||
|
||||
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
|
||||
|
@ -25,16 +25,34 @@
|
||||
// Author : Jean-Michel BOULCOURT
|
||||
// Module : SMESH
|
||||
|
||||
using namespace std;
|
||||
#include "SMDS_MeshIDFactory.ixx"
|
||||
|
||||
#include "SMDS_MeshIDFactory.hxx"
|
||||
|
||||
//=======================================================================
|
||||
//function : SMDS_MeshIDFactory
|
||||
//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);
|
||||
}
|
||||
|
@ -27,90 +27,20 @@
|
||||
#ifndef _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"
|
||||
#endif
|
||||
|
||||
|
||||
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
|
||||
//
|
||||
#include <stack>
|
||||
using namespace std;
|
||||
|
||||
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
|
||||
|
@ -25,5 +25,4 @@
|
||||
// Author : Jean-Michel BOULCOURT
|
||||
// Module : SMESH
|
||||
|
||||
using namespace std;
|
||||
#include "SMDS_MeshObject.ixx"
|
||||
#include "SMDS_MeshObject.hxx"
|
||||
|
@ -27,79 +27,8 @@
|
||||
#ifndef _SMDS_MeshObject_HeaderFile
|
||||
#define _SMDS_MeshObject_HeaderFile
|
||||
|
||||
#ifndef _Standard_HeaderFile
|
||||
#include <Standard.hxx>
|
||||
#endif
|
||||
#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
|
||||
//
|
||||
|
||||
|
||||
class SMDS_MeshObject
|
||||
{
|
||||
public:
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -25,16 +25,33 @@
|
||||
// Author : Jean-Michel BOULCOURT
|
||||
// Module : SMESH
|
||||
|
||||
using namespace std;
|
||||
#include "SMDS_Position.ixx"
|
||||
#include "SMDS_Position.hxx"
|
||||
|
||||
//=======================================================================
|
||||
//function : SMDS_Position
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
SMDS_Position::SMDS_Position(const Standard_Integer aShapeId,
|
||||
const SMDS_TypeOfPosition aType)
|
||||
:myShapeId(aShapeId),myType(aType)
|
||||
SMDS_Position::SMDS_Position(int aShapeId) :myShapeId(aShapeId)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetShapeId
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void SMDS_Position::SetShapeId(int aShapeId)
|
||||
{
|
||||
myShapeId = aShapeId;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetShapeId
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
int SMDS_Position::GetShapeId() const
|
||||
{
|
||||
return myShapeId;
|
||||
}
|
||||
|
@ -27,94 +27,22 @@
|
||||
#ifndef _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"
|
||||
#endif
|
||||
#ifndef _MMgt_TShared_HeaderFile
|
||||
#include <MMgt_TShared.hxx>
|
||||
#endif
|
||||
class gp_Pnt;
|
||||
|
||||
class SMDS_Position
|
||||
{
|
||||
|
||||
class SMDS_Position : 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 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;
|
||||
public:
|
||||
const virtual double * Coords() const = 0;
|
||||
virtual inline SMDS_TypeOfPosition GetTypeOfPosition() const = 0;
|
||||
void SetShapeId(int aShapeId);
|
||||
int GetShapeId() const;
|
||||
~SMDS_Position();
|
||||
|
||||
protected:
|
||||
SMDS_Position(int aShapeId);
|
||||
|
||||
private:
|
||||
int myShapeId;
|
||||
};
|
||||
|
||||
|
||||
#include "SMDS_Position.lxx"
|
||||
|
||||
|
||||
|
||||
// other inline functions and methods (like "C++: function call" methods)
|
||||
//
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -25,47 +25,35 @@
|
||||
// Author : Jean-Michel BOULCOURT
|
||||
// Module : SMESH
|
||||
|
||||
using namespace std;
|
||||
#include "SMDS_SpacePosition.ixx"
|
||||
#include "SMDS_SpacePosition.hxx"
|
||||
|
||||
//=======================================================================
|
||||
//function : SMDS_SpacePosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
SMDS_SpacePosition::SMDS_SpacePosition()
|
||||
:SMDS_Position(0,SMDS_TOP_3DSPACE),myCoords(0.,0.,0.)
|
||||
SMDS_SpacePosition::SMDS_SpacePosition(double x, double y, double z):
|
||||
SMDS_Position(0)
|
||||
{
|
||||
myCoords[0]=x;
|
||||
myCoords[1]=y;
|
||||
myCoords[2]=z;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SMDS_SpacePosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
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)
|
||||
/**
|
||||
*/
|
||||
SMDS_TypeOfPosition SMDS_SpacePosition::GetTypeOfPosition() const
|
||||
{
|
||||
return SMDS_TOP_3DSPACE;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SMDS_SpacePosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
SMDS_SpacePosition::SMDS_SpacePosition(const gp_Pnt& aCoords)
|
||||
:SMDS_Position(0,SMDS_TOP_3DSPACE),myCoords(aCoords)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Coords
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt SMDS_SpacePosition::Coords() const
|
||||
const double * SMDS_SpacePosition::Coords() const
|
||||
{
|
||||
return myCoords;
|
||||
}
|
||||
|
||||
SMDS_SpacePosition * SMDS_SpacePosition::originSpacePosition()
|
||||
{
|
||||
static SMDS_SpacePosition * staticpos=new SMDS_SpacePosition();
|
||||
return staticpos;
|
||||
}
|
||||
|
@ -27,94 +27,20 @@
|
||||
#ifndef _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"
|
||||
#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
|
||||
|
@ -27,17 +27,13 @@
|
||||
#ifndef _SMDS_TypeOfPosition_HeaderFile
|
||||
#define _SMDS_TypeOfPosition_HeaderFile
|
||||
|
||||
enum SMDS_TypeOfPosition {
|
||||
enum SMDS_TypeOfPosition
|
||||
{
|
||||
SMDS_TOP_UNSPEC,
|
||||
SMDS_TOP_3DSPACE,
|
||||
SMDS_TOP_VERTEX,
|
||||
SMDS_TOP_EDGE,
|
||||
SMDS_TOP_FACE
|
||||
SMDS_TOP_3DSPACE,
|
||||
SMDS_TOP_VERTEX,
|
||||
SMDS_TOP_EDGE,
|
||||
SMDS_TOP_FACE
|
||||
};
|
||||
|
||||
|
||||
#ifndef _Standard_PrimitiveTypes_HeaderFile
|
||||
#include <Standard_PrimitiveTypes.hxx>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -25,8 +25,7 @@
|
||||
// Author : Jean-Michel BOULCOURT
|
||||
// Module : SMESH
|
||||
|
||||
using namespace std;
|
||||
#include "SMDS_VertexPosition.ixx"
|
||||
#include "SMDS_VertexPosition.hxx"
|
||||
#include "utilities.h"
|
||||
|
||||
//=======================================================================
|
||||
@ -34,29 +33,25 @@ using namespace std;
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
SMDS_VertexPosition::SMDS_VertexPosition()
|
||||
:SMDS_Position(0,SMDS_TOP_VERTEX)
|
||||
SMDS_VertexPosition:: SMDS_VertexPosition(const int aVertexId)
|
||||
:SMDS_Position(aVertexId)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SMDS_VertexPosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
SMDS_VertexPosition::SMDS_VertexPosition(const Standard_Integer aVertexId)
|
||||
:SMDS_Position(aVertexId,SMDS_TOP_VERTEX)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Coords
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt SMDS_VertexPosition::Coords() const
|
||||
const double *SMDS_VertexPosition::Coords() const
|
||||
{
|
||||
MESSAGE( "SMDS_VertexPosition::Coords not implemented" );
|
||||
return gp_Pnt(0,0,0);
|
||||
const static double origin[]={0,0,0};
|
||||
MESSAGE("SMDS_EdgePosition::Coords not implemented");
|
||||
return origin;
|
||||
}
|
||||
|
||||
|
||||
SMDS_TypeOfPosition SMDS_VertexPosition::GetTypeOfPosition() const
|
||||
{
|
||||
return SMDS_TOP_VERTEX;
|
||||
}
|
||||
|
@ -27,86 +27,16 @@
|
||||
#ifndef _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"
|
||||
#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
|
||||
|
Loading…
Reference in New Issue
Block a user