Salome HOME
DCQ: prepare V2.0.0
[modules/geom.git] / src / GEOM / GEOM_Shape_i.hh
1 //  GEOM GEOM : implementaion of GEOM_Gen.idl and GEOM_Shape.idl
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : GEOM_Shape_i.hh
25 //  Author : Lucien PIGNOLONI
26 //  Module : GEOM
27 //  $Header$
28
29 #ifndef __GEOM_SHAPE_I_H__
30 #define __GEOM_SHAPE_I_H__
31
32 // SALOME config header
33 #include <SALOMEconfig.h>
34
35 // Standard C++ headers
36 #include <iostream.h>
37
38 // IDL headers
39 #include CORBA_SERVER_HEADER(GEOM_Gen)
40 #include CORBA_SERVER_HEADER(GEOM_Shape)
41
42 // Cascade headers
43 #include <TopoDS_Shape.hxx>
44 #include <TopoDS_Vertex.hxx>
45 #include <TopExp_Explorer.hxx>
46 #include <BRep_Tool.hxx>
47 #include <gp_Pnt.hxx>
48 #include <TopoDS.hxx>
49
50
51 //=====================================================================
52 // GEOM_Shape_i : class definition
53 //=====================================================================
54 class GEOM_Shape_i: public POA_GEOM::GEOM_Shape,
55                     public PortableServer::RefCountServantBase {
56 private:
57   
58   TopoDS_Shape _geom;
59   CORBA::ORB_ptr _orb;
60   GEOM::GEOM_Gen_ptr _engine;
61   
62   GEOM::shape_type _shapetype ; // enum defined in the IDL file (Occ topol. type of a shape)
63   bool _ismain;
64   GEOM::GEOM_Shape::ListOfSubShapeID _index;
65   char* _name;
66   char* _mainname;
67   char* _shapeid;
68   char* _studyshapeid; // exists only if added in the study document
69   char* _nametype;
70  
71
72 public:
73
74   // no-arg constructor, doing nothing (for now ?)
75   GEOM_Shape_i();
76   
77   // constructor to be called for servant creation
78   GEOM_Shape_i(TopoDS_Shape geom,
79                CORBA::ORB_ptr orb,
80                GEOM::GEOM_Gen_ptr engine,
81                const GEOM::GEOM_Shape::ListOfSubShapeID& index,
82                GEOM::shape_type sht = GEOM::SHAPE, 
83                bool ismain = true);
84   
85   // destructor deleting the internal geometry structure
86   ~GEOM_Shape_i();
87  
88   char* Name();
89   void  Name(const char* name);
90   
91   char* MainName();
92   void  MainName(const char* name);
93
94   char* NameType();
95   void  NameType(const char* name);
96
97   bool  IsMainShape(); 
98   void  IsMainShape(const bool abool);
99
100   char* ShapeId(); 
101   void  ShapeId(const char* shapeid);
102
103   char* StudyShapeId();
104   void  StudyShapeId(const char* studyshapeid);
105
106   GEOM::GEOM_Shape::ListOfSubShapeID* Index();
107   void  Index(const GEOM::GEOM_Shape::ListOfSubShapeID&);
108
109   GEOM::shape_type ShapeType();
110   void  ShapeType(GEOM::shape_type sht);
111
112   GEOM::GEOM_Shape::TMPFile* GetShapeStream();
113
114   GEOM::GEOM_Gen_ptr Engine();
115
116   long getShape();
117 };
118   
119 #endif