Salome HOME
7e84fc2b0734b6c6c7b41cdddfd7f260d0dc4171
[modules/shaper_study.git] / src / StudyData / StudyData_Object.h
1 // Copyright (C) 2019-2020  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef StudyData_Object_H
21
22 #include "StudyData.h"
23
24 #include <SALOMEconfig.h>
25 #include CORBA_SERVER_HEADER(GEOM_Gen)
26
27 #include <TopoDS_Shape.hxx>
28 #include <list>
29
30 class StudyData_EXPORT StudyData_Object
31 {
32 public:
33   StudyData_Object(const std::string theFile);
34   StudyData_Object();
35
36   int type() const;
37
38   std::string shapeStream() const;
39   std::string oldShapeStream() const;
40
41   // returns the stored shape
42   long long shape() const;
43
44   // updates the current shape if needed
45   void updateShape(const std::string theFile);
46
47   // returns the version number of the shape starting from 1
48   int getTick() const;
49
50   // sets the version number of the shape starting from 1
51   void setTick(const int theValue);
52
53   // sets the shape by the pointer to the TopoDS_Shape
54   void SetShapeByPointer(const long long theShape);
55
56   // returns the group shape related to the current selection in the group
57   long long groupShape(long long theMainShape, const std::list<long> theSelection);
58
59 private:
60   std::string myStream, myOldStream; // the current and old stream of a shape
61   TopoDS_Shape myShape, myOldShape; // latest shape of this object and the old one
62   int myTick; // version index of the shape
63 };
64
65 #endif // !StudyData_Object_H