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