1 // Copyright (C) 2019-2021 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef StudyData_Operation_H
22 #include "StudyData.h"
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
31 StudyData_Operation() {}
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);
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);
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);
46 /// Get a sub-shape defined by its unique ID within theMainShape.
47 long long GetSubShape(const long long theMainShape, long theID);
49 // Extract shapes of given type
50 std::list<long long> ExtractSubShapes(const long long theMainShape,
51 const int theShapeType,
52 const bool theIsSorted);
54 std::list<double> PointCoordinates(const long long theVertex);
56 double MinDistance(const long long theVertex1, const long long theVertex2);
58 int NumberOfEdges(const long long theShape);
60 int NumberOfFaces(const long long theShape);
62 int GetTopologyIndex(const long long theMainShape, const long long theSubShape);
64 double GetTolerance( const long long theShape);
66 long long GetVertexByIndex(const long long theEdge, int theIndex, bool theUseOri );
69 #endif // !StudyData_Operation_H