0027008: Visualization - polygonal selection algorithm does not work with MeshVS_Mesh
[occt.git] / src / StdPrs / StdPrs_ToolQuadric.hxx
CommitLineData
625e1958 1// Created on: 2016-02-04
2// Created by: Anastasia BORISOVA
3// Copyright (c) 2016 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _StdPrs_ToolQuadric_HeaderFile
17#define _StdPrs_ToolQuadric_HeaderFile
18
19#include <gp_Ax1.hxx>
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>
27
28//! Base class to build 3D surfaces presentation of quadric surfaces.
29class StdPrs_ToolQuadric
30{
31public:
32
33 DEFINE_STANDARD_ALLOC
34
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);
37
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);
40
41protected:
42
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);
45
46 //! Number of triangles in generated presentation.
47 Standard_Integer TrianglesNb() const
48 {
49 return mySlicesNb * myStacksNb * 2;
50 }
51
52 //! Redefine this method to generate vertex at given parameters.
53 virtual gp_Pnt Vertex (const Standard_Real theU, const Standard_Real theV) = 0;
54
55 //! Redefine this method to generate normal at given parameters.
56 virtual gp_Dir Normal (const Standard_Real theU, const Standard_Real theV) = 0;
57
58protected:
59
60 Standard_Integer mySlicesNb;
61 Standard_Integer myStacksNb;
62};
63
64#endif // _StdPrs_ShadedSurface_HeaderFile