1 // Created on: 2016-02-04
2 // Created by: Anastasia BORISOVA
3 // Copyright (c) 2016 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _Prs3d_ToolQuadric_HeaderFile
17 #define _Prs3d_ToolQuadric_HeaderFile
19 #include <Graphic3d_ArrayOfTriangles.hxx>
20 #include <Poly_Triangulation.hxx>
22 //! Base class to build 3D surfaces presentation of quadric surfaces.
23 class Prs3d_ToolQuadric
29 //! Generate primitives for 3D quadric surface and fill the given array. Optional transformation is applied.
30 Standard_EXPORT void FillArray (Handle(Graphic3d_ArrayOfTriangles)& theArray, const gp_Trsf& theTrsf);
32 //! Generate primitives for 3D quadric surface presentation and fill the given array and poly triangulation structure. Optional transformation is applied.
33 Standard_EXPORT void FillArray (Handle(Graphic3d_ArrayOfTriangles)& theArray, Handle(Poly_Triangulation)& theTriangulation, const gp_Trsf& theTrsf);
35 //! Number of triangles for presentation with the given params.
36 static Standard_Integer TrianglesNb (const Standard_Integer theSlicesNb,
37 const Standard_Integer theStacksNb)
39 return theSlicesNb * theStacksNb * 2;
44 //! Method implements an algorithm to generate arrays of vertices and normals for 3D surface.
45 Standard_EXPORT void fillArrays (const gp_Trsf& theTrsf, TColgp_Array1OfPnt& theArray, NCollection_Array1<gp_Dir>& theNormals);
47 //! Number of triangles in generated presentation.
48 Standard_Integer TrianglesNb() const
50 return mySlicesNb * myStacksNb * 2;
53 //! Redefine this method to generate vertex at given parameters.
54 virtual gp_Pnt Vertex (const Standard_Real theU, const Standard_Real theV) = 0;
56 //! Redefine this method to generate normal at given parameters.
57 virtual gp_Dir Normal (const Standard_Real theU, const Standard_Real theV) = 0;
61 Standard_Integer mySlicesNb;
62 Standard_Integer myStacksNb;
65 #endif // _Prs3d_ToolQuadric_HeaderFile