0030924: Coding - incorrect header in file OSD_ThreadPool.hxx
[occt.git] / src / BRepGProp / BRepGProp_MeshProps.hxx
CommitLineData
4b114473 1// Copyright (c) 2018 OPEN CASCADE SAS
87018b45 2//
3// This file is part of Open CASCADE Technology software library.
4//
5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Lesser General Public License version 2.1 as published
7// by the Free Software Foundation, with special exception defined in the file
8// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9// distribution for complete text of the license and disclaimer of any warranty.
10//
11// Alternatively, this file may be used under the terms of Open CASCADE
12// commercial license or contractual agreement.
4b114473 13
14#ifndef _BRepGProp_MeshProps_HeaderFile
15#define _BRepGProp_MeshProps_HeaderFile
16
4b114473 17#include <GProp_GProps.hxx>
18#include <TopAbs_Orientation.hxx>
19#include <Poly_Array1OfTriangle.hxx>
20#include <TColgp_Array1OfPnt.hxx>
21
22class Poly_Triangulation;
23class TopLoc_Location;
24class gp_Pnt;
25
26
27//! Computes the global properties of a surface mesh. The mesh can be
28//! interpreted as just a surface or as a piece of volume limited by this surface.
29class BRepGProp_MeshProps : public GProp_GProps
30{
31public:
32
33 DEFINE_STANDARD_ALLOC
34
87018b45 35 //! Describes types of geometric objects.
36 //! - Vinert is 3D closed region of space delimited with
37 //! Point and surface mesh;
38 //! - Sinert is surface mesh in 3D space.
39 typedef enum { Vinert = 0, Sinert } BRepGProp_MeshObjType;
4b114473 40
41 //! Constructor takes the type of object.
42 BRepGProp_MeshProps(const BRepGProp_MeshObjType theType) :
43 myType(theType)
44 {}
45
46 //! Sets the point relative which the calculation is to be done
47 void SetLocation(const gp_Pnt& theLocation) { loc = theLocation; }
48
49 //! Computes the global properties of a surface mesh of 3D space.
50 //! Calculation of surface properties is performed by numerical integration
51 //! over triangle surfaces using Gauss cubature formulas.
52 //! Depending on the mesh object type used in constructor this method can
53 //! calculate the surface or volume properties of the mesh.
54 Standard_EXPORT void Perform(const Handle(Poly_Triangulation)& theMesh,
55 const TopLoc_Location& theLoc,
56 const TopAbs_Orientation theOri);
57
58 Standard_EXPORT void Perform(const TColgp_Array1OfPnt& theNodes,
59 const Poly_Array1OfTriangle& theTriangles,
60 const TopAbs_Orientation theOri);
61
62 //! Computes the global properties of triangle {p1, p2, p3} relatively
63 //! point Apex
64 //! If isVolume = true, volume properties are calculated
65 //! otherwise - surface ones
66 Standard_EXPORT static void CalculateProps(const gp_Pnt& p1, const gp_Pnt& p2, const gp_Pnt& p3,
67 const gp_Pnt& Apex,
68 const Standard_Boolean isVolume,
69 Standard_Real GProps[10],
70 const Standard_Integer NbGaussPoints,
71 const Standard_Real* GaussPnts);
72
73 //! Get type of mesh object
74 BRepGProp_MeshObjType GetMeshObjType() const
75 {
76 return myType;
77 }
78
79private: //! @name private fields
80
81
82 BRepGProp_MeshObjType myType; //!< Type of geometric object
83
84};
85
86#endif // _BRepGProp_MeshProps_HeaderFile