1 // Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef StudyData_Operation_H
25 #include "StudyData.h"
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
34 StudyData_Operation() {}
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);
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);
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);
49 /// Get a sub-shape defined by its unique ID within theMainShape.
50 long long GetSubShape(const long long theMainShape, long theID);
52 // Extract shapes of given type
53 std::list<long long> ExtractSubShapes(const long long theMainShape,
54 const int theShapeType,
55 const bool theIsSorted);
57 std::list<double> PointCoordinates(const long long theVertex);
59 double MinDistance(const long long theVertex1, const long long theVertex2);
61 int NumberOfEdges(const long long theShape);
63 int NumberOfFaces(const long long theShape);
65 int GetTopologyIndex(const long long theMainShape, const long long theSubShape);
67 double GetTolerance( const long long theShape);
69 long long GetVertexByIndex(const long long theEdge, int theIndex, bool theUseOri );
72 #endif // !StudyData_Operation_H