Salome HOME
Make comparison of updated shapes better.
[modules/shaper_study.git] / src / StudyData / StudyData_Operation.h
1 // Copyright (C) 2007-2019  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  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, or (at your option) any later version.
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef StudyData_Operation_H
24
25 #include "StudyData.h"
26
27 #include <list>
28
29 /// Class for specific shape operations call that can be implemented in C++ only
30 /// with usage of the OpenCascade shapes.
31 class StudyData_EXPORT StudyData_Operation
32 {
33 public:
34   StudyData_Operation() {}
35
36   /// Explode a shape on sub-shapes of a given type.
37   /// If isSorted is true, sub-shapes will be sorted by coordinates of their gravity center
38   std::list<long> GetAllSubShapesIDs(
39     const long long theShape, const int theShapeType, const bool isSorted);
40
41   /// Get pointers to sub-shapes, shared by input shapes.
42   std::list<long long> GetSharedShapes(
43     const long long theShape1, const long long theShape2, const int theShapeType);
44
45   /// Returns the theSubShape index in theMainShape. Shapes are passed as pointers values.
46   /// Returns zero if there is no such sub-shape in the main shape.
47   int GetSubShapeIndex(const long long theMainShape, const long long theSubShape);
48
49   /// Get a sub-shape defined by its unique ID within theMainShape.
50   long long GetSubShape(const long long theMainShape, long theID);
51
52   // Extract shapes of given type
53   std::list<long long> ExtractSubShapes(const long long theMainShape,
54                                         const int       theShapeType,
55                                         const bool      theIsSorted);
56
57   std::list<double> PointCoordinates(const long long theVertex);
58
59   double MinDistance(const long long theVertex1, const long long theVertex2);
60
61   int NumberOfEdges(const long long theShape);
62   
63   int NumberOfFaces(const long long theShape);
64
65   int GetTopologyIndex(const long long theMainShape, const long long theSubShape);
66
67   double GetTolerance( const long long theShape);
68
69   long long GetVertexByIndex(const long long theEdge, int theIndex, bool theUseOri );
70 };
71
72 #endif // !StudyData_Operation_H