mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024291: Visualization - move Z-buffer trihedron presentation from TKOpenGl to TKV3d
Not implemented method V3d_View::TriedronEcho() and enum Aspect_TypeOfTriedronEcho have been removed. The following methods have been removed from Graphic3d_CView class: TriedronDisplay(), TriedronErase(), ZBufferTriedronSetup(), TriedronEcho(). New class V3d_Trihedron has been added as replacement of removed OpenGl_Trihedron which now uses Graphic3d_TMF_TriedronPers persistence.
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <StdPrs_ToolCylinder.hxx>
|
||||
|
||||
#include <Graphic3d_ArrayOfTriangles.hxx>
|
||||
@@ -25,17 +24,17 @@
|
||||
//function : Constructor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
StdPrs_ToolCylinder::StdPrs_ToolCylinder (const Standard_ShortReal theBottomRad,
|
||||
const Standard_ShortReal theTopRad,
|
||||
const Standard_ShortReal theHeight,
|
||||
const Standard_Integer theSlicesNb,
|
||||
const Standard_Integer theStacksNb)
|
||||
StdPrs_ToolCylinder::StdPrs_ToolCylinder (const Standard_Real theBottomRad,
|
||||
const Standard_Real theTopRad,
|
||||
const Standard_Real theHeight,
|
||||
const Standard_Integer theNbSlices,
|
||||
const Standard_Integer theNbStacks)
|
||||
: myBottomRadius (theBottomRad),
|
||||
myTopRadius (theTopRad),
|
||||
myHeight (theHeight)
|
||||
{
|
||||
myStacksNb = theStacksNb;
|
||||
mySlicesNb = theSlicesNb;
|
||||
myStacksNb = theNbStacks;
|
||||
mySlicesNb = theNbSlices;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -44,10 +43,10 @@ StdPrs_ToolCylinder::StdPrs_ToolCylinder (const Standard_ShortReal theBottomRad,
|
||||
//=======================================================================
|
||||
gp_Pnt StdPrs_ToolCylinder::Vertex (const Standard_Real theU, const Standard_Real theV)
|
||||
{
|
||||
const Standard_ShortReal aU = static_cast<Standard_ShortReal> (theU * M_PI * 2.0);
|
||||
const Standard_ShortReal aRadius = myBottomRadius + (myTopRadius - myBottomRadius) * (Standard_ShortReal)theV;
|
||||
return gp_Pnt (cosf(aU) * aRadius,
|
||||
sinf(aU) * aRadius,
|
||||
const Standard_Real aU = theU * M_PI * 2.0;
|
||||
const Standard_Real aRadius = myBottomRadius + (myTopRadius - myBottomRadius) * theV;
|
||||
return gp_Pnt (Cos (aU) * aRadius,
|
||||
Sin (aU) * aRadius,
|
||||
theV * myHeight);
|
||||
}
|
||||
|
||||
@@ -57,8 +56,25 @@ gp_Pnt StdPrs_ToolCylinder::Vertex (const Standard_Real theU, const Standard_Rea
|
||||
//=======================================================================
|
||||
gp_Dir StdPrs_ToolCylinder::Normal (const Standard_Real theU, const Standard_Real /*theV*/)
|
||||
{
|
||||
const Standard_ShortReal aU = static_cast<Standard_ShortReal> (theU * M_PI * 2.0);
|
||||
return gp_Dir (gp_Vec(cosf(aU) * myHeight,
|
||||
sinf(aU) * myHeight,
|
||||
myBottomRadius - myTopRadius).Normalized().XYZ());
|
||||
const Standard_Real aU = theU * M_PI * 2.0;
|
||||
return gp_Dir (Cos (aU) * myHeight,
|
||||
Sin (aU) * myHeight,
|
||||
myBottomRadius - myTopRadius);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Graphic3d_ArrayOfTriangles) StdPrs_ToolCylinder::Create (const Standard_Real theBottomRad,
|
||||
const Standard_Real theTopRad,
|
||||
const Standard_Real theHeight,
|
||||
const Standard_Integer theNbSlices,
|
||||
const Standard_Integer theNbStacks,
|
||||
const gp_Trsf& theTrsf)
|
||||
{
|
||||
Handle(Graphic3d_ArrayOfTriangles) anArray;
|
||||
StdPrs_ToolCylinder aTool (theBottomRad, theTopRad, theHeight, theNbSlices, theNbStacks);
|
||||
aTool.FillArray (anArray, theTrsf);
|
||||
return anArray;
|
||||
}
|
||||
|
@@ -24,14 +24,23 @@ class StdPrs_ToolCylinder : public StdPrs_ToolQuadric
|
||||
{
|
||||
public:
|
||||
|
||||
//! Generate primitives for 3D quadric surface and return a filled array.
|
||||
Standard_EXPORT static Handle(Graphic3d_ArrayOfTriangles) Create (const Standard_Real theBottomRad,
|
||||
const Standard_Real theTopRad,
|
||||
const Standard_Real theHeight,
|
||||
const Standard_Integer theNbSlices,
|
||||
const Standard_Integer theNbStacks,
|
||||
const gp_Trsf& theTrsf);
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Initializes the algorithm.
|
||||
Standard_EXPORT StdPrs_ToolCylinder (const Standard_ShortReal theBottomRad,
|
||||
const Standard_ShortReal theTopRad,
|
||||
const Standard_ShortReal theHeight,
|
||||
const Standard_Integer theSlicesNb,
|
||||
const Standard_Integer theStacksNb);
|
||||
Standard_EXPORT StdPrs_ToolCylinder (const Standard_Real theBottomRad,
|
||||
const Standard_Real theTopRad,
|
||||
const Standard_Real theHeight,
|
||||
const Standard_Integer theNbSlices,
|
||||
const Standard_Integer theNbStacks);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -43,9 +52,10 @@ protected:
|
||||
|
||||
protected:
|
||||
|
||||
Standard_ShortReal myBottomRadius;
|
||||
Standard_ShortReal myTopRadius;
|
||||
Standard_ShortReal myHeight;
|
||||
Standard_Real myBottomRadius;
|
||||
Standard_Real myTopRadius;
|
||||
Standard_Real myHeight;
|
||||
|
||||
};
|
||||
|
||||
#endif // _StdPrs_ToolCylinder_HeaderFile
|
||||
|
@@ -13,7 +13,6 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <StdPrs_ToolDisk.hxx>
|
||||
|
||||
#include <Graphic3d_ArrayOfTriangles.hxx>
|
||||
@@ -24,15 +23,15 @@
|
||||
//function : Constructor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
StdPrs_ToolDisk::StdPrs_ToolDisk (const Standard_ShortReal theInnerRadius,
|
||||
const Standard_ShortReal theOuterRadius,
|
||||
const Standard_Integer theSlicesNb,
|
||||
const Standard_Integer theStacksNb)
|
||||
StdPrs_ToolDisk::StdPrs_ToolDisk (const Standard_Real theInnerRadius,
|
||||
const Standard_Real theOuterRadius,
|
||||
const Standard_Integer theNbSlices,
|
||||
const Standard_Integer theNbStacks)
|
||||
: myInnerRadius (theInnerRadius),
|
||||
myOuterRadius (theOuterRadius)
|
||||
{
|
||||
mySlicesNb = theSlicesNb;
|
||||
myStacksNb = theStacksNb;
|
||||
mySlicesNb = theNbSlices;
|
||||
myStacksNb = theNbStacks;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -41,11 +40,11 @@ StdPrs_ToolDisk::StdPrs_ToolDisk (const Standard_ShortReal theInnerRadius,
|
||||
//=======================================================================
|
||||
gp_Pnt StdPrs_ToolDisk::Vertex (const Standard_Real theU, const Standard_Real theV)
|
||||
{
|
||||
const Standard_ShortReal aU = static_cast<Standard_ShortReal> (theU * M_PI * 2.0);
|
||||
const Standard_ShortReal aRadius = myInnerRadius + (myOuterRadius - myInnerRadius) * (Standard_ShortReal)theV;
|
||||
return gp_Pnt (cosf(aU) * aRadius,
|
||||
sinf(aU) * aRadius,
|
||||
0.0f);
|
||||
const Standard_Real aU = theU * M_PI * 2.0;
|
||||
const Standard_Real aRadius = myInnerRadius + (myOuterRadius - myInnerRadius) * theV;
|
||||
return gp_Pnt (Cos (aU) * aRadius,
|
||||
Sin (aU) * aRadius,
|
||||
0.0);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -54,5 +53,21 @@ gp_Pnt StdPrs_ToolDisk::Vertex (const Standard_Real theU, const Standard_Real th
|
||||
//=======================================================================
|
||||
gp_Dir StdPrs_ToolDisk::Normal (const Standard_Real /*theU*/, const Standard_Real /*theV*/)
|
||||
{
|
||||
return gp_Dir(0.0f, 0.0f, -1.0f);
|
||||
return gp_Dir (0.0, 0.0, -1.0);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Graphic3d_ArrayOfTriangles) StdPrs_ToolDisk::Create (const Standard_Real theInnerRadius,
|
||||
const Standard_Real theOuterRadius,
|
||||
const Standard_Integer theNbSlices,
|
||||
const Standard_Integer theNbStacks,
|
||||
const gp_Trsf& theTrsf)
|
||||
{
|
||||
Handle(Graphic3d_ArrayOfTriangles) anArray;
|
||||
StdPrs_ToolDisk aTool (theInnerRadius, theOuterRadius, theNbSlices, theNbStacks);
|
||||
aTool.FillArray (anArray, theTrsf);
|
||||
return anArray;
|
||||
}
|
||||
|
@@ -24,14 +24,21 @@ class StdPrs_ToolDisk : public StdPrs_ToolQuadric
|
||||
{
|
||||
public:
|
||||
|
||||
//! Generate primitives for 3D quadric surface and return a filled array.
|
||||
Standard_EXPORT static Handle(Graphic3d_ArrayOfTriangles) Create (const Standard_Real theInnerRadius,
|
||||
const Standard_Real theOuterRadius,
|
||||
const Standard_Integer theNbSlices,
|
||||
const Standard_Integer theNbStacks,
|
||||
const gp_Trsf& theTrsf);
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Initializes the algorithm.
|
||||
Standard_EXPORT StdPrs_ToolDisk (const Standard_ShortReal theInnerRadius,
|
||||
const Standard_ShortReal theOuterRadius,
|
||||
const Standard_Integer theSlicesNb,
|
||||
const Standard_Integer theStacksNb);
|
||||
|
||||
Standard_EXPORT StdPrs_ToolDisk (const Standard_Real theInnerRadius,
|
||||
const Standard_Real theOuterRadius,
|
||||
const Standard_Integer theNbSlices,
|
||||
const Standard_Integer theNbStacks);
|
||||
protected:
|
||||
|
||||
//! Computes vertex at given parameter location of the surface.
|
||||
@@ -42,9 +49,9 @@ protected:
|
||||
|
||||
protected:
|
||||
|
||||
Standard_ShortReal myInnerRadius;
|
||||
Standard_ShortReal myOuterRadius;
|
||||
Standard_Real myInnerRadius;
|
||||
Standard_Real myOuterRadius;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
@@ -23,13 +23,13 @@
|
||||
//function : Constructor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
StdPrs_ToolSphere::StdPrs_ToolSphere (const Standard_ShortReal theRadius,
|
||||
const Standard_Integer theSlicesNb,
|
||||
const Standard_Integer theStacksNb)
|
||||
StdPrs_ToolSphere::StdPrs_ToolSphere (const Standard_Real theRadius,
|
||||
const Standard_Integer theNbSlices,
|
||||
const Standard_Integer theNbStacks)
|
||||
: myRadius (theRadius)
|
||||
{
|
||||
mySlicesNb = theSlicesNb;
|
||||
myStacksNb = theStacksNb;
|
||||
mySlicesNb = theNbSlices;
|
||||
myStacksNb = theNbStacks;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -38,11 +38,11 @@ StdPrs_ToolSphere::StdPrs_ToolSphere (const Standard_ShortReal theRadius,
|
||||
//=======================================================================
|
||||
gp_Pnt StdPrs_ToolSphere::Vertex (const Standard_Real theU, const Standard_Real theV)
|
||||
{
|
||||
const Standard_ShortReal aU = static_cast<Standard_ShortReal> (theU * M_PI * 2.0);
|
||||
const Standard_ShortReal aV = static_cast<Standard_ShortReal> (theV * M_PI);
|
||||
return gp_Pnt (myRadius * cosf(aU) * sinf(aV),
|
||||
-myRadius * sinf(aU) * sinf(aV),
|
||||
myRadius * cosf(aV));
|
||||
const Standard_Real aU = theU * M_PI * 2.0;
|
||||
const Standard_Real aV = theV * M_PI;
|
||||
return gp_Pnt (myRadius * Cos (aU) * Sin (aV),
|
||||
-myRadius * Sin (aU) * Sin (aV),
|
||||
myRadius * Cos (aV));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
@@ -51,9 +51,24 @@ gp_Pnt StdPrs_ToolSphere::Vertex (const Standard_Real theU, const Standard_Real
|
||||
//=======================================================================
|
||||
gp_Dir StdPrs_ToolSphere::Normal (const Standard_Real theU, const Standard_Real theV)
|
||||
{
|
||||
const Standard_ShortReal aU = static_cast<Standard_ShortReal> (theU * M_PI * 2.0);
|
||||
const Standard_ShortReal aV = static_cast<Standard_ShortReal> (theV * M_PI);
|
||||
return gp_Dir (cosf(aU) * sinf(aV),
|
||||
-sinf(aU) * sinf(aV),
|
||||
cosf(aV));
|
||||
const Standard_Real aU = theU * M_PI * 2.0;
|
||||
const Standard_Real aV = theV * M_PI;
|
||||
return gp_Dir (Cos (aU) * Sin (aV),
|
||||
-Sin (aU) * Sin (aV),
|
||||
Cos (aV));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Perform
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Handle(Graphic3d_ArrayOfTriangles) StdPrs_ToolSphere::Create (const Standard_Real theRadius,
|
||||
const Standard_Integer theNbSlices,
|
||||
const Standard_Integer theNbStacks,
|
||||
const gp_Trsf& theTrsf)
|
||||
{
|
||||
Handle(Graphic3d_ArrayOfTriangles) anArray;
|
||||
StdPrs_ToolSphere aTool (theRadius, theNbSlices, theNbStacks);
|
||||
aTool.FillArray (anArray, theTrsf);
|
||||
return anArray;
|
||||
}
|
||||
|
@@ -31,12 +31,19 @@ class StdPrs_ToolSphere : public StdPrs_ToolQuadric
|
||||
{
|
||||
public:
|
||||
|
||||
//! Generate primitives for 3D quadric surface and return a filled array.
|
||||
Standard_EXPORT static Handle(Graphic3d_ArrayOfTriangles) Create (const Standard_Real theRadius,
|
||||
const Standard_Integer theNbSlices,
|
||||
const Standard_Integer theNbStacks,
|
||||
const gp_Trsf& theTrsf);
|
||||
public:
|
||||
|
||||
DEFINE_STANDARD_ALLOC
|
||||
|
||||
//! Initializes the algorithm.
|
||||
Standard_EXPORT StdPrs_ToolSphere (const Standard_ShortReal theRadius,
|
||||
const Standard_Integer theSlicesNb,
|
||||
const Standard_Integer theStacksNb);
|
||||
Standard_EXPORT StdPrs_ToolSphere (const Standard_Real theRadius,
|
||||
const Standard_Integer theNbSlices,
|
||||
const Standard_Integer theNbStacks);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -48,8 +55,8 @@ protected:
|
||||
|
||||
protected:
|
||||
|
||||
Standard_ShortReal myRadius;
|
||||
Standard_Real myRadius;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user