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 _StdPrs_ToolQuadric_HeaderFile
17 #define _StdPrs_ToolQuadric_HeaderFile
20 #include <Graphic3d_ArrayOfPrimitives.hxx>
21 #include <Graphic3d_ArrayOfTriangles.hxx>
22 #include <Poly_Triangulation.hxx>
23 #include <Prs3d_Root.hxx>
24 #include <Prs3d_Drawer.hxx>
25 #include <SelectMgr_Selection.hxx>
26 #include <Standard.hxx>
28 //! Base class to build 3D surfaces presentation of quadric surfaces.
29 class StdPrs_ToolQuadric
35 //! Generate primitives for 3D quadric surface and fill the given array. Optional transformation is applied.
36 Standard_EXPORT void FillArray (Handle(Graphic3d_ArrayOfTriangles)& theArray, const gp_Trsf& theTrsf);
38 //! Generate primitives for 3D quadric surface presentation and fill the given array and poly triangulation structure. Optional transformation is applied.
39 Standard_EXPORT void FillArray (Handle(Graphic3d_ArrayOfTriangles)& theArray, Handle(Poly_Triangulation)& theTriangulation, const gp_Trsf& theTrsf);
43 //! Method implements an algorithm to generate arrays of vertices and normals for 3D surface.
44 Standard_EXPORT void fillArrays (const gp_Trsf& theTrsf, TColgp_Array1OfPnt& theArray, NCollection_Array1<gp_Dir>& theNormals);
46 //! Number of triangles in generated presentation.
47 Standard_Integer TrianglesNb() const
49 return mySlicesNb * myStacksNb * 2;
52 //! Redefine this method to generate vertex at given parameters.
53 virtual gp_Pnt Vertex (const Standard_Real theU, const Standard_Real theV) = 0;
55 //! Redefine this method to generate normal at given parameters.
56 virtual gp_Dir Normal (const Standard_Real theU, const Standard_Real theV) = 0;
60 Standard_Integer mySlicesNb;
61 Standard_Integer myStacksNb;
64 #endif // _StdPrs_ShadedSurface_HeaderFile