Salome HOME
Remove Opencascade dependencies
authorjrt <jrt>
Wed, 3 Sep 2003 17:29:04 +0000 (17:29 +0000)
committerjrt <jrt>
Wed, 3 Sep 2003 17:29:04 +0000 (17:29 +0000)
19 files changed:
src/SMDS/SMDS_EdgePosition.cxx
src/SMDS/SMDS_EdgePosition.hxx
src/SMDS/SMDS_FacePosition.cxx
src/SMDS/SMDS_FacePosition.hxx
src/SMDS/SMDS_MeshElementIDFactory.cxx
src/SMDS/SMDS_MeshElementIDFactory.hxx
src/SMDS/SMDS_MeshGroup.cxx
src/SMDS/SMDS_MeshGroup.hxx
src/SMDS/SMDS_MeshIDFactory.cxx
src/SMDS/SMDS_MeshIDFactory.hxx
src/SMDS/SMDS_MeshObject.cxx
src/SMDS/SMDS_MeshObject.hxx
src/SMDS/SMDS_Position.cxx
src/SMDS/SMDS_Position.hxx
src/SMDS/SMDS_SpacePosition.cxx
src/SMDS/SMDS_SpacePosition.hxx
src/SMDS/SMDS_TypeOfPosition.hxx
src/SMDS/SMDS_VertexPosition.cxx
src/SMDS/SMDS_VertexPosition.hxx

index d9d4caecd92525ea00c9c2dbe713f313ec9b6f38..e2f7d9755b9da670e6f8c4e9527f4b39f279fd67 100644 (file)
@@ -25,8 +25,7 @@
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
-using namespace std;
-#include "SMDS_EdgePosition.ixx"
+#include "SMDS_EdgePosition.hxx"
 #include "utilities.h"
 
 //=======================================================================
 #include "utilities.h"
 
 //=======================================================================
@@ -34,29 +33,41 @@ using namespace std;
 //purpose  : 
 //=======================================================================
 
 //purpose  : 
 //=======================================================================
 
-SMDS_EdgePosition::SMDS_EdgePosition()
-  :SMDS_Position(0,SMDS_TOP_EDGE),myUParameter(0.)
+SMDS_EdgePosition::SMDS_EdgePosition(const int aEdgeId,
+       const double aUParam):SMDS_Position(aEdgeId), myUParameter(aUParam)
 {
 }
 
 //=======================================================================
 {
 }
 
 //=======================================================================
-//function : SMDS_EdgePosition
+//function : Coords
 //purpose  : 
 //=======================================================================
 
 //purpose  : 
 //=======================================================================
 
-SMDS_EdgePosition::SMDS_EdgePosition(const Standard_Integer aEdgeId,
-                                    const Standard_Real aUParam)
-  :SMDS_Position(aEdgeId,SMDS_TOP_EDGE),myUParameter(aUParam)
+const double *SMDS_EdgePosition::Coords() const
+{
+       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 : Coords
+//function : GetUParameter
 //purpose  : 
 //=======================================================================
 
 //purpose  : 
 //=======================================================================
 
-gp_Pnt SMDS_EdgePosition::Coords() const
+double SMDS_EdgePosition::GetUParameter() const 
 {
 {
-  MESSAGE( "SMDS_EdgePosition::Coords not implemented" );
-  return gp_Pnt(0,0,0);
+       return myUParameter;
 }
 }
index 5bce2261489184b410602c4abcea0f4f39c54b7f..868310b51967d338060b24aaae358a0ff2d1799d 100644 (file)
 #ifndef _SMDS_EdgePosition_HeaderFile
 #define _SMDS_EdgePosition_HeaderFile
 
 #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"
 #include "SMDS_Position.hxx"
-#endif
-#ifndef _Standard_Integer_HeaderFile
-#include <Standard_Integer.hxx>
-#endif
-class gp_Pnt;
-
-
-class SMDS_EdgePosition : 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_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:
+class SMDS_EdgePosition:public SMDS_Position
+{
 
 
- // Methods PROTECTED
- // 
+  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();
 
 
+  private:
 
 
- // 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
index df458d5b2c122e5de74bedc7366a780e39026cd2..57a98e7d4d6fc5261a233838d792019f12536507 100644 (file)
@@ -25,8 +25,7 @@
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
-using namespace std;
-#include "SMDS_FacePosition.ixx"
+#include "SMDS_FacePosition.hxx"
 #include "utilities.h"
 
 //=======================================================================
 #include "utilities.h"
 
 //=======================================================================
@@ -34,31 +33,63 @@ using namespace std;
 //purpose  : 
 //=======================================================================
 
 //purpose  : 
 //=======================================================================
 
-SMDS_FacePosition::SMDS_FacePosition()
-  :SMDS_Position(0,SMDS_TOP_FACE),myUParameter(0.),myVParameter(0.)
+SMDS_FacePosition::SMDS_FacePosition(const int aEdgeId,
+                                    const double aUParam,
+                                    const double aVParam)
+  :SMDS_Position(aEdgeId),
+   myUParameter(aUParam),myVParameter(aVParam)
 {
 }
 
 //=======================================================================
 {
 }
 
 //=======================================================================
-//function : SMDS_FacePosition
+//function : Coords
 //purpose  : 
 //=======================================================================
 //purpose  : 
 //=======================================================================
+const double *SMDS_FacePosition::Coords() const
+{
+       static double origin[]={0,0,0};
+       MESSAGE("SMDS_EdgePosition::Coords not implemented");
+       return origin;
+}
 
 
-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)
+/**
+*/
+SMDS_TypeOfPosition SMDS_FacePosition::GetTypeOfPosition() const
 {
 {
+       return SMDS_TOP_FACE;
+}
+
+void SMDS_FacePosition::SetUParameter(double aUparam)
+{
+       myUParameter = aUparam;
 }
 
 //=======================================================================
 }
 
 //=======================================================================
-//function : Coords
+//function : SetVParameter
+//purpose  : 
+//=======================================================================
+
+void SMDS_FacePosition::SetVParameter(double aVparam)
+{
+       myVParameter = aVparam;
+}
+
+//=======================================================================
+//function : GetUParameter
+//purpose  : 
+//=======================================================================
+
+double SMDS_FacePosition::GetUParameter() const 
+{
+       return myUParameter;
+}
+
+//=======================================================================
+//function : GetVParameter
 //purpose  : 
 //=======================================================================
 
 //purpose  : 
 //=======================================================================
 
-gp_Pnt SMDS_FacePosition::Coords() const
+double SMDS_FacePosition::GetVParameter() const 
 {
 {
-  MESSAGE( "SMDS_FacePosition::Coords not implemented" );
-  return gp_Pnt(0,0,0);
+       return myVParameter;
 }
 }
index acdcb0ae291c21af56fc50ea45ac9466435c5078..255fd05d8cecde7b938a9d887eea57fd16297c77 100644 (file)
 #ifndef _SMDS_FacePosition_HeaderFile
 #define _SMDS_FacePosition_HeaderFile
 
 #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"
 #include "SMDS_Position.hxx"
-#endif
-#ifndef _Standard_Integer_HeaderFile
-#include <Standard_Integer.hxx>
-#endif
-class gp_Pnt;
-
-
-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;
-
 
 
+class SMDS_FacePosition:public SMDS_Position
+{
+
+  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
 #endif
index 5413533ea1cc5bef0879ffd391e4c4e03abdfafa..d635b0110c15ea89c0360c75d87946aaa202f336 100644 (file)
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
 //  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  : 
 //=======================================================================
 
 //=======================================================================
 //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;
+}
index 1d7480b49ee902332988872f190774e1a75a70c8..8814676335d34505bea659a419044d47232ecfe0 100644 (file)
 #ifndef _SMDS_MeshElementIDFactory_HeaderFile
 #define _SMDS_MeshElementIDFactory_HeaderFile
 
 #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"
 #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
-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();
-
-
-
+#include <SMDS_Iterator.hxx>
 
 
- // 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;
+#include <map>
+using namespace std;
 
 
-protected:
-
- // Methods PROTECTED
- // 
-
-
- // Fields PROTECTED
- //
-
-
-private: 
-
- // Methods PRIVATE
- // 
-
-
- // Fields PRIVATE
- //
-SMDS_DataMapOfIntegerMeshElement myIDElements;
+class SMDS_MeshElement;
 
 
+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
 #endif
index da85821dae056d732587d6e38a210bc3514802c7..25e942abb32b7e0bc075d64988a6811a68034e3c 100644 (file)
 //  Module : SMESH
 
 using namespace std;
 //  Module : SMESH
 
 using namespace std;
-#include "SMDS_MeshGroup.ixx"
-#include "SMDS_ListIteratorOfListOfMeshGroup.hxx"
-
+#include "SMDS_MeshGroup.hxx"
+#include "utilities.h"
 //=======================================================================
 //function : SMDS_MeshGroup
 //purpose  : 
 //=======================================================================
 
 //=======================================================================
 //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  : 
 //=======================================================================
 
 //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,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);
-  if (!subgroup.IsNull()) {
-    myChildren.Append(subgroup);
-  }
-  return subgroup;
+       const SMDS_MeshGroup * subgroup = new SMDS_MeshGroup(this);
+       myChildren.insert(myChildren.end(),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;
-
-  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);
-    }
-  }
-
-  return found;
+       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);
+               }
+       }
+
+       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;
-
-  return (myParent->RemoveSubGroup(this));
-
+       
+       if (myParent==NULL) return false;
+       else
+       {
+               return (myParent->RemoveSubGroup(this));
+       }
 }
 }
-
 //=======================================================================
 //function : Clear
 //purpose  : 
 //=======================================================================
 //function : Clear
 //purpose  : 
@@ -105,8 +102,8 @@ Standard_Boolean SMDS_MeshGroup::RemoveFromParent()
 
 void SMDS_MeshGroup::Clear()
 {
 
 void SMDS_MeshGroup::Clear()
 {
-  myElements.Clear();
-  myType = SMDSAbs_All;
+       myElements.clear();
+       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
-  if (myElements.IsEmpty()) {
-    myType = ME->GetType();
-  }
-
-  if (ME->GetType() != myType) { 
-    Standard_TypeMismatch::Raise("SMDS_MeshGroup::Add");
-  }
-
-  myElements.Add(ME);
+       // the type of the group is determined by the first element added
+       if (myElements.empty()) myType = ME->GetType();
+       else if (ME->GetType() != myType)
+               MESSAGE("SMDS_MeshGroup::Add : Type Mismatch");
+       
+       myElements.insert(ME);
 }
 
 }
 
-
 //=======================================================================
 //function : Remove
 //purpose  : 
 //=======================================================================
 
 //=======================================================================
 //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;
 }
 
 //=======================================================================
 }
 
 //=======================================================================
@@ -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();
 }
 }
index 5df197b27b2440eace92f09e41c33674a0a5dc3b..f73c1dd1f4a79bc51ab36f6b070e0c755940ec38 100644 (file)
 #ifndef _SMDS_MeshGroup_HeaderFile
 #define _SMDS_MeshGroup_HeaderFile
 
 #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
 #endif
index 6e02557e08b771936625113e0c6bcae92a4873ac..a68ae5ad0325a37bfe530818c2349cf123f77c17 100644 (file)
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
-using namespace std;
-#include "SMDS_MeshIDFactory.ixx"
 
 
+#include "SMDS_MeshIDFactory.hxx"
 
 //=======================================================================
 //function : SMDS_MeshIDFactory
 //purpose  : 
 //=======================================================================
 
 
 //=======================================================================
 //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);
+}
index 4c5581d0451bad83dd4b5d4d62f814c4a319885a..76ac5ee91f903b85a74ee9ef414c5d78d1dcd3b4 100644 (file)
 #ifndef _SMDS_MeshIDFactory_HeaderFile
 #define _SMDS_MeshIDFactory_HeaderFile
 
 #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"
 #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
 #endif
index 1efac384ffd72f375800fe97a54cc2681edc6f8c..b822b80988e50464acee3e32bee29023ddb9b8f2 100644 (file)
@@ -25,5 +25,4 @@
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
-using namespace std;
-#include "SMDS_MeshObject.ixx"
+#include "SMDS_MeshObject.hxx"
index 4610ca1876e735adc581ca2cf850824813e3c5e2..7e4bcd464717bbfa976bf1b3a228fea3f1ea84ea 100644 (file)
 #ifndef _SMDS_MeshObject_HeaderFile
 #define _SMDS_MeshObject_HeaderFile
 
 #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
 #endif
index dfba3ca63a75ae9db4b660ccf1a5322707e45692..0a634ceb2eb0eeddc508f4973648b9cc2ab5dc72 100644 (file)
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
-using namespace std;
-#include "SMDS_Position.ixx"
+#include "SMDS_Position.hxx"
 
 //=======================================================================
 //function : SMDS_Position
 //purpose  : 
 //=======================================================================
 
 
 //=======================================================================
 //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;
+}
index 50ebcffcd80531692e880765e827f06439494a48..29a54d82b624235c606e335eba4ec3c45553048a 100644 (file)
 #ifndef _SMDS_Position_HeaderFile
 #define _SMDS_Position_HeaderFile
 
 #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"
 #include "SMDS_TypeOfPosition.hxx"
-#endif
-#ifndef _MMgt_TShared_HeaderFile
-#include <MMgt_TShared.hxx>
-#endif
-class gp_Pnt;
-
-
-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);
+class SMDS_Position
+{
 
 
+  public:
+       const virtual double * Coords() const = 0;
+       virtual inline SMDS_TypeOfPosition GetTypeOfPosition() const = 0;
+       void SetShapeId(int aShapeId);
+       int GetShapeId() const;
+        ~SMDS_Position();
 
 
- // 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
index 573c36a406c12fb2fdf692bea8ba19f4ffb0bb99..82ef3d54f78f7a042036b3a3461e9352a407a2fe 100644 (file)
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
-using namespace std;
-#include "SMDS_SpacePosition.ixx"
+#include "SMDS_SpacePosition.hxx"
 
 //=======================================================================
 //function : SMDS_SpacePosition
 //purpose  : 
 //=======================================================================
 
 
 //=======================================================================
 //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)
+const double * SMDS_SpacePosition::Coords() const
 {
 {
+       return myCoords;
 }
 
 }
 
-//=======================================================================
-//function : Coords
-//purpose  : 
-//=======================================================================
-
-gp_Pnt SMDS_SpacePosition::Coords() const
+SMDS_SpacePosition * SMDS_SpacePosition::originSpacePosition()
 {
 {
-  return myCoords;
+       static SMDS_SpacePosition * staticpos=new SMDS_SpacePosition();
+       return staticpos;
 }
 }
index c2f5ee1a45be799faa83b22ea9a5dd40e43cf04e..af995f175f8ed9c71812fb5c9dc188a4b7368397 100644 (file)
 #ifndef _SMDS_SpacePosition_HeaderFile
 #define _SMDS_SpacePosition_HeaderFile
 
 #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"
 #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
index 54b18211ad70ea85cd997b82d453e0239eb15ecf..9de8b7fb8055684f9e54d7af84c34bb96ef3fce7 100644 (file)
 #ifndef _SMDS_TypeOfPosition_HeaderFile
 #define _SMDS_TypeOfPosition_HeaderFile
 
 #ifndef _SMDS_TypeOfPosition_HeaderFile
 #define _SMDS_TypeOfPosition_HeaderFile
 
-enum SMDS_TypeOfPosition { 
- SMDS_TOP_UNSPEC,
-SMDS_TOP_3DSPACE,
-SMDS_TOP_VERTEX,
-SMDS_TOP_EDGE,
-SMDS_TOP_FACE
+enum SMDS_TypeOfPosition
+{
+       SMDS_TOP_UNSPEC,
+       SMDS_TOP_3DSPACE,
+       SMDS_TOP_VERTEX,
+       SMDS_TOP_EDGE,
+       SMDS_TOP_FACE
 };
 
 };
 
-
-#ifndef _Standard_PrimitiveTypes_HeaderFile
-#include <Standard_PrimitiveTypes.hxx>
-#endif
-
 #endif
 #endif
index ed554f335145bcc165217e1c070b85e110272bce..8757ad4d3d1c65f76137a0eaf7293ce18ff62c84 100644 (file)
@@ -25,8 +25,7 @@
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
 //  Author : Jean-Michel BOULCOURT
 //  Module : SMESH
 
-using namespace std;
-#include "SMDS_VertexPosition.ixx"
+#include "SMDS_VertexPosition.hxx"
 #include "utilities.h"
 
 //=======================================================================
 #include "utilities.h"
 
 //=======================================================================
@@ -34,29 +33,25 @@ using namespace std;
 //purpose  : 
 //=======================================================================
 
 //purpose  : 
 //=======================================================================
 
-SMDS_VertexPosition::SMDS_VertexPosition()
-  :SMDS_Position(0,SMDS_TOP_VERTEX)
+SMDS_VertexPosition:: SMDS_VertexPosition(const int aVertexId)
+       :SMDS_Position(aVertexId)
 {
 }
 
 //=======================================================================
 {
 }
 
 //=======================================================================
-//function : SMDS_VertexPosition
+//function : Coords
 //purpose  : 
 //=======================================================================
 
 //purpose  : 
 //=======================================================================
 
-SMDS_VertexPosition::SMDS_VertexPosition(const Standard_Integer aVertexId)
-  :SMDS_Position(aVertexId,SMDS_TOP_VERTEX)
+const double *SMDS_VertexPosition::Coords() const
 {
 {
+       const static double origin[]={0,0,0};
+       MESSAGE("SMDS_EdgePosition::Coords not implemented");
+       return origin;
 }
 
 
 }
 
 
-//=======================================================================
-//function : Coords
-//purpose  : 
-//=======================================================================
-
-gp_Pnt SMDS_VertexPosition::Coords() const
+SMDS_TypeOfPosition SMDS_VertexPosition::GetTypeOfPosition() const
 {
 {
-  MESSAGE( "SMDS_VertexPosition::Coords not implemented" );
-  return gp_Pnt(0,0,0);
+       return SMDS_TOP_VERTEX;
 }
 }
index 8577eaf9c67785b5a7a671124949d94d8ee86aaf..6fc5a3c61132aa174af54f2f61fca2d2308a5afa 100644 (file)
 #ifndef _SMDS_VertexPosition_HeaderFile
 #define _SMDS_VertexPosition_HeaderFile
 
 #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"
 #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