Salome HOME
NRI : Add documentation.
[modules/geom.git] / src / GEOM / GEOM_Shape_i.hh
1 // File :      GEOM_Shape_i.hh
2 // Created :   29 november 2001
3 // Author :    Lucien PIGNOLONI
4 // Project :   SALOME
5 // Copyright : OPEN CASCADE
6 // $Header$
7
8
9 #ifndef __GEOM_SHAPE_I_H__
10 #define __GEOM_SHAPE_I_H__
11
12 // SALOME config header
13 #include <SALOMEconfig.h>
14
15 // Standard C++ headers
16 #include <iostream.h>
17
18 // IDL headers
19 #include CORBA_SERVER_HEADER(GEOM_Gen)
20 #include CORBA_SERVER_HEADER(GEOM_Shape)
21
22 // Cascade headers
23 #include <TopoDS_Shape.hxx>
24 #include <TopoDS_Vertex.hxx>
25 #include <TopExp_Explorer.hxx>
26 #include <BRep_Tool.hxx>
27 #include <gp_Pnt.hxx>
28 #include <TopoDS.hxx>
29
30
31 //=====================================================================
32 // GEOM_Shape_i : class definition
33 //=====================================================================
34 class GEOM_Shape_i: public POA_GEOM::GEOM_Shape,
35                     public PortableServer::RefCountServantBase {
36 private:
37   
38   TopoDS_Shape _geom;
39   CORBA::ORB_ptr _orb;
40   GEOM::GEOM_Gen_ptr _engine;
41   
42   GEOM::shape_type _shapetype ; // enum defined in the IDL file (Occ topol. type of a shape)
43   bool _ismain;
44   GEOM::GEOM_Shape::ListOfSubShapeID _index;
45   char* _name;
46   char* _mainname;
47   char* _shapeid;
48   char* _studyshapeid; // exists only if added in the study document
49   char* _nametype;
50  
51
52 public:
53
54   // no-arg constructor, doing nothing (for now ?)
55   GEOM_Shape_i();
56   
57   // constructor to be called for servant creation
58   GEOM_Shape_i(TopoDS_Shape geom,
59                CORBA::ORB_ptr orb,
60                GEOM::GEOM_Gen_ptr engine,
61                const GEOM::GEOM_Shape::ListOfSubShapeID& index,
62                GEOM::shape_type sht = GEOM::SHAPE, 
63                bool ismain = true);
64   
65   // destructor deleting the internal geometry structure
66   ~GEOM_Shape_i();
67  
68   char* Name();
69   void  Name(const char* name);
70   
71   char* MainName();
72   void  MainName(const char* name);
73
74   char* NameType();
75   void  NameType(const char* name);
76
77   bool  IsMainShape(); 
78   void  IsMainShape(const bool abool);
79
80   char* ShapeId(); 
81   void  ShapeId(const char* shapeid);
82
83   char* StudyShapeId();
84   void  StudyShapeId(const char* studyshapeid);
85
86   GEOM::GEOM_Shape::ListOfSubShapeID* Index();
87   void  Index(const GEOM::GEOM_Shape::ListOfSubShapeID&);
88
89   GEOM::shape_type ShapeType();
90   void  ShapeType(GEOM::shape_type sht);
91
92   GEOM::GEOM_Shape::TMPFile* GetShapeStream();
93
94   GEOM::GEOM_Gen_ptr Engine();
95 };
96   
97 #endif