mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-05 18:16:23 +03:00
0023634: Eliminate Polyline and Polygon usage in drawers
Polylines and polygons removed, now everything is based on PrimitiveArrays. Added use of Graphic3d_ArrayOfSegments, some additional clean up in Graphic3d_Group. Dead code elimination in AIS and V3d Corrected compilation errors Fixed grid presentation Adding test case correction
This commit is contained in:
parent
44cf55e600
commit
b8ddfc2f5d
@ -101,7 +101,7 @@
|
|||||||
#include <GC_MakeConicalSurface.hxx>
|
#include <GC_MakeConicalSurface.hxx>
|
||||||
#include <gce_MakePln.hxx>
|
#include <gce_MakePln.hxx>
|
||||||
#include <gce_MakeCone.hxx>
|
#include <gce_MakeCone.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Constructor
|
//function : Constructor
|
||||||
@ -1975,19 +1975,17 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select
|
|||||||
|
|
||||||
gp_Pnt AttachmentPnt;
|
gp_Pnt AttachmentPnt;
|
||||||
gp_Pnt OppositePnt;
|
gp_Pnt OppositePnt;
|
||||||
gp_Pnt aPnt, tmpPnt;
|
|
||||||
Quantity_Length X,Y,Z;
|
|
||||||
|
|
||||||
Standard_Real param = ElCLib::Parameter(myCircle, myPosition);
|
Standard_Real param = ElCLib::Parameter(myCircle, myPosition);
|
||||||
|
|
||||||
aPnt = Apex;
|
gp_Pnt aPnt = Apex;
|
||||||
gp_Pnt P1 = ElCLib::Value(0., myCircle);
|
gp_Pnt P1 = ElCLib::Value(0., myCircle);
|
||||||
gp_Pnt P2 = ElCLib::Value(M_PI, myCircle);
|
gp_Pnt P2 = ElCLib::Value(M_PI, myCircle);
|
||||||
|
|
||||||
gce_MakePln mkPln(P1, P2, aPnt); // create a plane whitch defines plane for projection aPosition on it
|
gce_MakePln mkPln(P1, P2, aPnt); // create a plane whitch defines plane for projection aPosition on it
|
||||||
|
|
||||||
aPnt = AIS::ProjectPointOnPlane(myPosition, mkPln.Value());
|
aPnt = AIS::ProjectPointOnPlane(myPosition, mkPln.Value());
|
||||||
tmpPnt = aPnt;
|
gp_Pnt tmpPnt = aPnt;
|
||||||
|
|
||||||
if( aPnt.Distance(P1) < aPnt.Distance(P2) ){
|
if( aPnt.Distance(P1) < aPnt.Distance(P2) ){
|
||||||
AttachmentPnt = P1;
|
AttachmentPnt = P1;
|
||||||
@ -2016,48 +2014,29 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select
|
|||||||
if( myPosition.Distance( myCircle.Location() ) <= myCircle.Radius() )
|
if( myPosition.Distance( myCircle.Location() ) <= myCircle.Radius() )
|
||||||
if( 2 * myCircle.Radius() > aCircle2.Radius() * 0.4 ) IsArrowOut = Standard_False; //four times more than an arrow size
|
if( 2 * myCircle.Radius() > aCircle2.Radius() * 0.4 ) IsArrowOut = Standard_False; //four times more than an arrow size
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1, 12);
|
param = AttParam;
|
||||||
|
Standard_Real angle = OppParam - AttParam;
|
||||||
|
|
||||||
Standard_Real angle;
|
if(IsArrowOut)
|
||||||
param = ElCLib::Parameter(aCircle2, tmpPnt);
|
{
|
||||||
|
angle += M_PI / 6; //An angle between AttParam and OppParam + 30 degrees
|
||||||
if(IsArrowOut) {
|
param -= M_PI / 12; //out parts of dimension line are 15 degrees
|
||||||
angle = OppParam - AttParam + M_PI / 6; //An angle between AttParam and OppParam + 30 degrees
|
|
||||||
param = AttParam - M_PI / 12; //out parts of dimension line are 15 degrees
|
|
||||||
|
|
||||||
while ( angle > 2 * M_PI ) angle -= 2 * M_PI;
|
|
||||||
for( i = 0; i <= 11; i++ ) { //calculating of arc
|
|
||||||
aPnt = ElCLib::Value(param + angle/11 * i, aCircle2);
|
|
||||||
aPnt.Coord(X, Y, Z);
|
|
||||||
V(i+1).SetCoord(X, Y, Z);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
angle = OppParam - AttParam;
|
|
||||||
param = AttParam;
|
|
||||||
while ( angle > 2 * M_PI ) angle -= 2 * M_PI;
|
|
||||||
for( i = 0; i <= 11; i++ ) { //calculating of arc
|
|
||||||
aPnt = ElCLib::Value(param + angle/11 * i, aCircle2);
|
|
||||||
aPnt.Coord(X, Y, Z);
|
|
||||||
V(i+1).SetCoord(X, Y, Z);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(i = 1; i<=11; i++) {
|
while ( angle > 2. * M_PI ) angle -= 2. * M_PI;
|
||||||
|
|
||||||
V(i).Coord(X, Y, Z);
|
gp_Pnt Vprev = ElCLib::Value(param, aCircle2);
|
||||||
P1.SetCoord(X, Y, Z);
|
for( i = 1; i <= 11; i++ ) //calculating of arc
|
||||||
V(i+1).Coord(X, Y, Z);
|
{
|
||||||
P1.SetCoord(X, Y, Z);
|
gp_Pnt Vcur = ElCLib::Value(param + angle/11 * i, aCircle2);
|
||||||
|
seg = new Select3D_SensitiveSegment(owner, Vprev, Vcur);
|
||||||
seg = new Select3D_SensitiveSegment(owner, P1, P2);
|
|
||||||
aSelection->Add(seg);
|
aSelection->Add(seg);
|
||||||
|
Vprev = Vcur;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpPnt = tmpPnt.Translated(gp_Vec(0, 0, -1)*2);
|
tmpPnt = tmpPnt.Translated(gp_Vec(0, 0, -2));
|
||||||
|
|
||||||
Standard_Real size(Min(myVal/100.+1.e-6,myArrowSize+1.e-6));
|
const Standard_Real size(Min(myVal/100.+1.e-6,myArrowSize+1.e-6));
|
||||||
Handle( Select3D_SensitiveBox ) box = new Select3D_SensitiveBox( owner,
|
Handle( Select3D_SensitiveBox ) box = new Select3D_SensitiveBox( owner,
|
||||||
tmpPnt.X(),
|
tmpPnt.X(),
|
||||||
tmpPnt.Y(),
|
tmpPnt.Y(),
|
||||||
@ -2067,6 +2046,3 @@ void AIS_AngleDimension::ComputeConeAngleSelection(const Handle(SelectMgr_Select
|
|||||||
tmpPnt.Z() + size);
|
tmpPnt.Z() + size);
|
||||||
aSelection->Add(box);
|
aSelection->Add(box);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,15 +19,13 @@
|
|||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#define GER61351 //GG_171199 Enable to set an object RGB color
|
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||||
// instead a restricted object NameOfColor.
|
|
||||||
|
|
||||||
#include <AIS_Axis.ixx>
|
#include <AIS_Axis.ixx>
|
||||||
#include <Aspect_TypeOfLine.hxx>
|
#include <Aspect_TypeOfLine.hxx>
|
||||||
#include <Prs3d_Drawer.hxx>
|
#include <Prs3d_Drawer.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
#include <Prs3d_DatumAspect.hxx>
|
#include <Prs3d_DatumAspect.hxx>
|
||||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
|
||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
#include <Graphic3d_Structure.hxx>
|
#include <Graphic3d_Structure.hxx>
|
||||||
#include <TColgp_Array1OfPnt.hxx>
|
#include <TColgp_Array1OfPnt.hxx>
|
||||||
@ -177,10 +175,7 @@ void AIS_Axis::Compute(const Handle(PrsMgr_PresentationManager3d)&,
|
|||||||
aPresentation->SetDisplayPriority(5);
|
aPresentation->SetDisplayPriority(5);
|
||||||
if (!myIsXYZAxis ){
|
if (!myIsXYZAxis ){
|
||||||
GeomAdaptor_Curve curv(myComponent);
|
GeomAdaptor_Curve curv(myComponent);
|
||||||
Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
|
|
||||||
if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
|
|
||||||
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
|
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
|
||||||
if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
DsgPrs_XYZAxisPresentation::Add(aPresentation,myLineAspect,myDir,myVal,myText,myPfirst,myPlast);
|
DsgPrs_XYZAxisPresentation::Add(aPresentation,myLineAspect,myDir,myVal,myText,myPfirst,myPlast);
|
||||||
@ -217,13 +212,11 @@ void AIS_Axis::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
|||||||
|
|
||||||
|
|
||||||
void AIS_Axis::SetColor(const Quantity_NameOfColor aCol)
|
void AIS_Axis::SetColor(const Quantity_NameOfColor aCol)
|
||||||
#ifdef GER61351
|
|
||||||
{
|
{
|
||||||
SetColor(Quantity_Color(aCol));
|
SetColor(Quantity_Color(aCol));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIS_Axis::SetColor(const Quantity_Color &aCol)
|
void AIS_Axis::SetColor(const Quantity_Color &aCol)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
hasOwnColor=Standard_True;
|
hasOwnColor=Standard_True;
|
||||||
myOwnColor=aCol;
|
myOwnColor=aCol;
|
||||||
|
@ -19,14 +19,12 @@
|
|||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#define GER61351 //GG_171199 Enable to set an object RGB color
|
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||||
// instead a restricted object NameOfColor.
|
|
||||||
|
|
||||||
#include <AIS_Circle.ixx>
|
#include <AIS_Circle.ixx>
|
||||||
#include <Aspect_TypeOfLine.hxx>
|
#include <Aspect_TypeOfLine.hxx>
|
||||||
#include <Prs3d_Drawer.hxx>
|
#include <Prs3d_Drawer.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
|
||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
#include <Graphic3d_Structure.hxx>
|
#include <Graphic3d_Structure.hxx>
|
||||||
#include <TColgp_Array1OfPnt.hxx>
|
#include <TColgp_Array1OfPnt.hxx>
|
||||||
@ -122,7 +120,6 @@ void AIS_Circle::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void AIS_Circle::SetColor(const Quantity_NameOfColor aCol)
|
void AIS_Circle::SetColor(const Quantity_NameOfColor aCol)
|
||||||
#ifdef GER61351
|
|
||||||
{
|
{
|
||||||
SetColor(Quantity_Color(aCol));
|
SetColor(Quantity_Color(aCol));
|
||||||
}
|
}
|
||||||
@ -133,7 +130,6 @@ void AIS_Circle::SetColor(const Quantity_NameOfColor aCol)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void AIS_Circle::SetColor(const Quantity_Color &aCol)
|
void AIS_Circle::SetColor(const Quantity_Color &aCol)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
hasOwnColor=Standard_True;
|
hasOwnColor=Standard_True;
|
||||||
myOwnColor=aCol;
|
myOwnColor=aCol;
|
||||||
@ -157,17 +153,10 @@ void AIS_Circle::SetWidth(const Standard_Real aValue)
|
|||||||
{
|
{
|
||||||
myOwnWidth=aValue;
|
myOwnWidth=aValue;
|
||||||
|
|
||||||
#ifndef GER61351
|
|
||||||
Quantity_NameOfColor CC =
|
|
||||||
HasColor() ? myOwnColor : AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!myDrawer->HasLineAspect ()) {
|
if (!myDrawer->HasLineAspect ()) {
|
||||||
#ifdef GER61351
|
|
||||||
Quantity_Color CC;
|
Quantity_Color CC;
|
||||||
if( HasColor() ) CC = myOwnColor;
|
if( HasColor() ) CC = myOwnColor;
|
||||||
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||||
#endif
|
|
||||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
|
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
|
||||||
} else
|
} else
|
||||||
myDrawer->LineAspect()->SetWidth(aValue);
|
myDrawer->LineAspect()->SetWidth(aValue);
|
||||||
@ -186,17 +175,12 @@ void AIS_Circle::UnsetColor()
|
|||||||
|
|
||||||
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
|
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
|
||||||
else{
|
else{
|
||||||
#ifdef GER61351
|
Quantity_Color CC;
|
||||||
Quantity_Color CC;
|
if( HasColor() ) CC = myOwnColor;
|
||||||
if( HasColor() ) CC = myOwnColor;
|
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||||
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
|
||||||
#else
|
|
||||||
Quantity_NameOfColor CC =
|
|
||||||
#endif
|
|
||||||
AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line);
|
|
||||||
myDrawer->LineAspect()->SetColor(CC);
|
myDrawer->LineAspect()->SetColor(CC);
|
||||||
myOwnColor = CC;
|
myOwnColor = CC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -225,10 +209,7 @@ void AIS_Circle::ComputeCircle( const Handle(Prs3d_Presentation)& aPresentation)
|
|||||||
GeomAdaptor_Curve curv(myComponent);
|
GeomAdaptor_Curve curv(myComponent);
|
||||||
Standard_Real prevdev = myDrawer->DeviationCoefficient();
|
Standard_Real prevdev = myDrawer->DeviationCoefficient();
|
||||||
myDrawer->SetDeviationCoefficient(1.e-5);
|
myDrawer->SetDeviationCoefficient(1.e-5);
|
||||||
Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
|
|
||||||
if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
|
|
||||||
StdPrs_DeflectionCurve::Add(aPresentation,curv,myDrawer);
|
StdPrs_DeflectionCurve::Add(aPresentation,curv,myDrawer);
|
||||||
if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
|
|
||||||
myDrawer->SetDeviationCoefficient(prevdev);
|
myDrawer->SetDeviationCoefficient(prevdev);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -240,16 +221,11 @@ void AIS_Circle::ComputeCircle( const Handle(Prs3d_Presentation)& aPresentation)
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_Circle::ComputeArc( const Handle(Prs3d_Presentation)& aPresentation)
|
void AIS_Circle::ComputeArc( const Handle(Prs3d_Presentation)& aPresentation)
|
||||||
{
|
{
|
||||||
|
|
||||||
GeomAdaptor_Curve curv(myComponent,myUStart,myUEnd);
|
GeomAdaptor_Curve curv(myComponent,myUStart,myUEnd);
|
||||||
Standard_Real prevdev = myDrawer->DeviationCoefficient();
|
Standard_Real prevdev = myDrawer->DeviationCoefficient();
|
||||||
myDrawer->SetDeviationCoefficient(1.e-5);
|
myDrawer->SetDeviationCoefficient(1.e-5);
|
||||||
Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
|
|
||||||
if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
|
|
||||||
StdPrs_DeflectionCurve::Add(aPresentation,curv,myDrawer);
|
StdPrs_DeflectionCurve::Add(aPresentation,curv,myDrawer);
|
||||||
if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
|
|
||||||
myDrawer->SetDeviationCoefficient(prevdev);
|
myDrawer->SetDeviationCoefficient(prevdev);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -19,8 +19,7 @@
|
|||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#define GER61351 //GG_171199 Enable to get an object RGB color
|
//GER61351 //GG_171199 Enable to get an object RGB color instead a restricted object NameOfColor.
|
||||||
// instead a restricted object NameOfColor.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -92,7 +91,6 @@ static Handle(Prs3d_LineAspect) GetLineAspect(const Handle(Prs3d_Drawer)& Dr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Quantity_NameOfColor AIS_GraphicTool::GetLineColor (const Handle(Prs3d_Drawer)& Dr, const AIS_TypeOfAttribute Att)
|
Quantity_NameOfColor AIS_GraphicTool::GetLineColor (const Handle(Prs3d_Drawer)& Dr, const AIS_TypeOfAttribute Att)
|
||||||
#ifdef GER61351
|
|
||||||
{
|
{
|
||||||
Quantity_Color color;
|
Quantity_Color color;
|
||||||
GetLineColor(Dr,Att,color);
|
GetLineColor(Dr,Att,color);
|
||||||
@ -100,20 +98,10 @@ Quantity_NameOfColor AIS_GraphicTool::GetLineColor (const Handle(Prs3d_Drawer)&
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AIS_GraphicTool::GetLineColor (const Handle(Prs3d_Drawer)& Dr, const AIS_TypeOfAttribute Att, Quantity_Color &aColor)
|
void AIS_GraphicTool::GetLineColor (const Handle(Prs3d_Drawer)& Dr, const AIS_TypeOfAttribute Att, Quantity_Color &aColor)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
Standard_Real W;
|
Standard_Real W;
|
||||||
Aspect_TypeOfLine TYP;
|
Aspect_TypeOfLine TYP;
|
||||||
|
GetLineAspect(Dr,Att)->Aspect()->Values(aColor,TYP,W);
|
||||||
Handle(Prs3d_LineAspect) LA = GetLineAspect(Dr,Att);
|
|
||||||
|
|
||||||
#ifdef GER61351
|
|
||||||
LA->Aspect()->Values(aColor,TYP,W);
|
|
||||||
#else
|
|
||||||
Quantity_Color QCol;
|
|
||||||
LA->Aspect()->Values(QCol,TYP,W);
|
|
||||||
return QCol.Name();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Real AIS_GraphicTool::GetLineWidth (const Handle(Prs3d_Drawer)& Dr,
|
Standard_Real AIS_GraphicTool::GetLineWidth (const Handle(Prs3d_Drawer)& Dr,
|
||||||
@ -159,7 +147,6 @@ void AIS_GraphicTool::GetLineAtt(const Handle(Prs3d_Drawer)& Dr,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Quantity_NameOfColor AIS_GraphicTool::GetInteriorColor(const Handle(Prs3d_Drawer)& Dr)
|
Quantity_NameOfColor AIS_GraphicTool::GetInteriorColor(const Handle(Prs3d_Drawer)& Dr)
|
||||||
#ifdef GER61351
|
|
||||||
{
|
{
|
||||||
Quantity_Color color;
|
Quantity_Color color;
|
||||||
GetInteriorColor(Dr,color);
|
GetInteriorColor(Dr,color);
|
||||||
@ -167,24 +154,16 @@ Quantity_NameOfColor AIS_GraphicTool::GetInteriorColor(const Handle(Prs3d_Drawer
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AIS_GraphicTool::GetInteriorColor(const Handle(Prs3d_Drawer)& Dr, Quantity_Color &aColor)
|
void AIS_GraphicTool::GetInteriorColor(const Handle(Prs3d_Drawer)& Dr, Quantity_Color &aColor)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
Handle(Graphic3d_AspectFillArea3d) AFA = Dr->ShadingAspect()->Aspect();
|
Handle(Graphic3d_AspectFillArea3d) AFA = Dr->ShadingAspect()->Aspect();
|
||||||
Aspect_InteriorStyle IS;
|
Aspect_InteriorStyle IS;
|
||||||
Aspect_TypeOfLine T;
|
Aspect_TypeOfLine T;
|
||||||
Standard_Real W;
|
Standard_Real W;
|
||||||
#ifdef GER61351
|
|
||||||
Quantity_Color EC;
|
Quantity_Color EC;
|
||||||
AFA->Values(IS,aColor,EC,T,W);
|
AFA->Values(IS,aColor,EC,T,W);
|
||||||
#else
|
|
||||||
Quantity_Color IC,EC;
|
|
||||||
AFA->Values(IS,IC,EC,T,W);
|
|
||||||
return IC.Name();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphic3d_MaterialAspect AIS_GraphicTool::GetMaterial(const Handle(Prs3d_Drawer)& Dr)
|
Graphic3d_MaterialAspect AIS_GraphicTool::GetMaterial(const Handle(Prs3d_Drawer)& Dr)
|
||||||
{
|
{
|
||||||
return Dr->ShadingAspect()->Aspect()->BackMaterial();
|
return Dr->ShadingAspect()->Aspect()->BackMaterial();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,12 +23,11 @@
|
|||||||
#define BUC60577 //GG_101099 Enable to compute correctly
|
#define BUC60577 //GG_101099 Enable to compute correctly
|
||||||
// transparency with more than one object in the view.
|
// transparency with more than one object in the view.
|
||||||
|
|
||||||
#define GER61351 //GG_171199 Enable to set an object RGB color
|
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||||
// instead a restricted object NameOfColor.
|
|
||||||
|
|
||||||
#define G003 //EUG_26/01/00 Degenerate support (G003)
|
#define G003 //EUG_26/01/00 Degenerate support (G003)
|
||||||
|
|
||||||
#define IMP140200 //GG Add SetSelectedAspect() method.
|
//IMP140200 //GG Add SetSelectedAspect() method.
|
||||||
|
|
||||||
#define BUC60632 //GG 15/03/00 Add protection on SetDisplayMode()
|
#define BUC60632 //GG 15/03/00 Add protection on SetDisplayMode()
|
||||||
// method, compute only authorized presentation.
|
// method, compute only authorized presentation.
|
||||||
@ -1914,15 +1913,13 @@ UnsetDisplayMode(const Handle(AIS_InteractiveObject)& anIObj,
|
|||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
#ifdef GER61351
|
|
||||||
void AIS_InteractiveContext::SetCurrentFacingModel(
|
void AIS_InteractiveContext::SetCurrentFacingModel(
|
||||||
const Handle(AIS_InteractiveObject)& anIObj,
|
const Handle(AIS_InteractiveObject)& anIObj,
|
||||||
const Aspect_TypeOfFacingModel aModel) {
|
const Aspect_TypeOfFacingModel aModel)
|
||||||
if ( !anIObj.IsNull () ) {
|
{
|
||||||
anIObj->SetCurrentFacingModel(aModel);
|
if ( !anIObj.IsNull () )
|
||||||
}
|
anIObj->SetCurrentFacingModel(aModel);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetColor
|
//function : SetColor
|
||||||
@ -1932,7 +1929,6 @@ void AIS_InteractiveContext::SetCurrentFacingModel(
|
|||||||
void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIObj,
|
void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIObj,
|
||||||
const Quantity_NameOfColor aColor,
|
const Quantity_NameOfColor aColor,
|
||||||
const Standard_Boolean updateviewer)
|
const Standard_Boolean updateviewer)
|
||||||
#ifdef GER61351
|
|
||||||
{
|
{
|
||||||
SetColor(anIObj,Quantity_Color(aColor),updateviewer);
|
SetColor(anIObj,Quantity_Color(aColor),updateviewer);
|
||||||
}
|
}
|
||||||
@ -1940,7 +1936,6 @@ void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIOb
|
|||||||
void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIObj,
|
void AIS_InteractiveContext::SetColor(const Handle(AIS_InteractiveObject)& anIObj,
|
||||||
const Quantity_Color &aColor,
|
const Quantity_Color &aColor,
|
||||||
const Standard_Boolean updateviewer)
|
const Standard_Boolean updateviewer)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if(anIObj.IsNull()) return ;
|
if(anIObj.IsNull()) return ;
|
||||||
|
|
||||||
@ -2292,13 +2287,11 @@ Quantity_NameOfColor AIS_InteractiveContext::Color(const Handle(AIS_InteractiveO
|
|||||||
return anIObj->Color();
|
return anIObj->Color();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GER61351
|
|
||||||
void AIS_InteractiveContext::Color(const Handle(AIS_InteractiveObject)& anIObj,
|
void AIS_InteractiveContext::Color(const Handle(AIS_InteractiveObject)& anIObj,
|
||||||
Quantity_Color &aColor) const
|
Quantity_Color &aColor) const
|
||||||
{
|
{
|
||||||
anIObj->Color(aColor);
|
anIObj->Color(aColor);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Width
|
//function : Width
|
||||||
@ -2541,7 +2534,6 @@ void AIS_InteractiveContext :: SetDegenerateModel (
|
|||||||
} // end AIS_InteractiveContext :: SetDegenerateModel
|
} // end AIS_InteractiveContext :: SetDegenerateModel
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef IMP140200
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetSelectedAspect
|
//function : SetSelectedAspect
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -2549,7 +2541,8 @@ void AIS_InteractiveContext :: SetDegenerateModel (
|
|||||||
void AIS_InteractiveContext::SetSelectedAspect(
|
void AIS_InteractiveContext::SetSelectedAspect(
|
||||||
const Handle(Prs3d_BasicAspect)& anAspect,
|
const Handle(Prs3d_BasicAspect)& anAspect,
|
||||||
const Standard_Boolean globalChange,
|
const Standard_Boolean globalChange,
|
||||||
const Standard_Boolean updateViewer) {
|
const Standard_Boolean updateViewer)
|
||||||
|
{
|
||||||
if( !HasOpenedContext() ) {
|
if( !HasOpenedContext() ) {
|
||||||
Standard_Boolean found = Standard_False;
|
Standard_Boolean found = Standard_False;
|
||||||
Handle(AIS_Selection) sel =
|
Handle(AIS_Selection) sel =
|
||||||
@ -2563,11 +2556,10 @@ void AIS_InteractiveContext::SetSelectedAspect(
|
|||||||
if( found && updateViewer) {
|
if( found && updateViewer) {
|
||||||
myMainVwr->Update();
|
myMainVwr->Update();
|
||||||
if( !(myIsCollClosed && myCollectorVwr.IsNull()) )
|
if( !(myIsCollClosed && myCollectorVwr.IsNull()) )
|
||||||
myCollectorVwr->Update();
|
myCollectorVwr->Update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : SetLocalAttributes
|
//function : SetLocalAttributes
|
||||||
|
@ -19,8 +19,7 @@
|
|||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#define GER61351 //GG_171199 Enable to set an object RGB color
|
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||||
// instead a restricted object NameOfColor.
|
|
||||||
|
|
||||||
|
|
||||||
inline Standard_Boolean AIS_InteractiveObject::AcceptShapeDecomposition() const
|
inline Standard_Boolean AIS_InteractiveObject::AcceptShapeDecomposition() const
|
||||||
@ -66,19 +65,13 @@ inline Standard_Integer AIS_InteractiveObject::SelectionMode() const
|
|||||||
|
|
||||||
inline Quantity_NameOfColor AIS_InteractiveObject::Color() const
|
inline Quantity_NameOfColor AIS_InteractiveObject::Color() const
|
||||||
{
|
{
|
||||||
#ifdef GER61351
|
return myOwnColor.Name();
|
||||||
return myOwnColor.Name();
|
|
||||||
#else
|
|
||||||
return myOwnColor;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef GER61351
|
|
||||||
inline void AIS_InteractiveObject::Color(Quantity_Color& aColor) const
|
inline void AIS_InteractiveObject::Color(Quantity_Color& aColor) const
|
||||||
{
|
{
|
||||||
aColor = myOwnColor;
|
aColor = myOwnColor;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
inline Standard_Boolean AIS_InteractiveObject::HasWidth() const
|
inline Standard_Boolean AIS_InteractiveObject::HasWidth() const
|
||||||
{return (!myOwnWidth == 0.);}
|
{return (!myOwnWidth == 0.);}
|
||||||
|
@ -19,15 +19,13 @@
|
|||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#define GER61351 //GG_171199 Enable to set an object RGB color
|
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||||
// instead a restricted object NameOfColor.
|
|
||||||
|
|
||||||
#include <AIS_Line.ixx>
|
#include <AIS_Line.ixx>
|
||||||
#include <Aspect_TypeOfLine.hxx>
|
#include <Aspect_TypeOfLine.hxx>
|
||||||
#include <Prs3d_Drawer.hxx>
|
#include <Prs3d_Drawer.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
|
||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
#include <Graphic3d_Structure.hxx>
|
#include <Graphic3d_Structure.hxx>
|
||||||
#include <TColgp_Array1OfPnt.hxx>
|
#include <TColgp_Array1OfPnt.hxx>
|
||||||
@ -157,13 +155,11 @@ void AIS_Line::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void AIS_Line::SetColor(const Quantity_NameOfColor aCol)
|
void AIS_Line::SetColor(const Quantity_NameOfColor aCol)
|
||||||
#ifdef GER61351
|
|
||||||
{
|
{
|
||||||
SetColor(Quantity_Color(aCol));
|
SetColor(Quantity_Color(aCol));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIS_Line::SetColor(const Quantity_Color &aCol)
|
void AIS_Line::SetColor(const Quantity_Color &aCol)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
hasOwnColor=Standard_True;
|
hasOwnColor=Standard_True;
|
||||||
myOwnColor=aCol;
|
myOwnColor=aCol;
|
||||||
@ -190,15 +186,9 @@ void AIS_Line::UnsetColor()
|
|||||||
|
|
||||||
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
|
if (!HasWidth()) myDrawer->SetLineAspect(NullAsp);
|
||||||
else{
|
else{
|
||||||
#ifdef GER61351
|
|
||||||
Quantity_Color CC;
|
Quantity_Color CC;
|
||||||
if( HasColor() ) CC = myOwnColor;
|
if( HasColor() ) CC = myOwnColor;
|
||||||
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||||
#else
|
|
||||||
Quantity_NameOfColor CC =
|
|
||||||
AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
myDrawer->LineAspect()->SetColor(CC);
|
myDrawer->LineAspect()->SetColor(CC);
|
||||||
myOwnColor = CC;
|
myOwnColor = CC;
|
||||||
}
|
}
|
||||||
@ -212,17 +202,10 @@ void AIS_Line::SetWidth(const Standard_Real aValue)
|
|||||||
{
|
{
|
||||||
myOwnWidth=aValue;
|
myOwnWidth=aValue;
|
||||||
|
|
||||||
#ifndef GER61351
|
|
||||||
Quantity_NameOfColor CC =
|
|
||||||
HasColor()? myOwnColor : AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!myDrawer->HasLineAspect ()) {
|
if (!myDrawer->HasLineAspect ()) {
|
||||||
#ifdef GER61351
|
|
||||||
Quantity_Color CC;
|
Quantity_Color CC;
|
||||||
if( HasColor() ) CC = myOwnColor;
|
if( HasColor() ) CC = myOwnColor;
|
||||||
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
else AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||||
#endif
|
|
||||||
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
|
myDrawer->SetLineAspect (new Prs3d_LineAspect(CC,Aspect_TOL_SOLID,aValue));
|
||||||
} else
|
} else
|
||||||
myDrawer->LineAspect()->SetWidth(aValue);
|
myDrawer->LineAspect()->SetWidth(aValue);
|
||||||
@ -251,16 +234,11 @@ void AIS_Line::UnsetWidth()
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_Line::ComputeInfiniteLine( const Handle(Prs3d_Presentation)& aPresentation)
|
void AIS_Line::ComputeInfiniteLine( const Handle(Prs3d_Presentation)& aPresentation)
|
||||||
{
|
{
|
||||||
|
|
||||||
GeomAdaptor_Curve curv(myComponent);
|
GeomAdaptor_Curve curv(myComponent);
|
||||||
Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
|
|
||||||
if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
|
|
||||||
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
|
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
|
||||||
if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
|
|
||||||
|
|
||||||
//pas de prise en compte lors du FITALL
|
//pas de prise en compte lors du FITALL
|
||||||
aPresentation->SetInfiniteState (Standard_True);
|
aPresentation->SetInfiniteState (Standard_True);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -269,7 +247,6 @@ void AIS_Line::ComputeInfiniteLine( const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
void AIS_Line::ComputeSegmentLine( const Handle(Prs3d_Presentation)& aPresentation)
|
void AIS_Line::ComputeSegmentLine( const Handle(Prs3d_Presentation)& aPresentation)
|
||||||
{
|
{
|
||||||
|
|
||||||
gp_Pnt P1 = myStartPoint->Pnt();
|
gp_Pnt P1 = myStartPoint->Pnt();
|
||||||
gp_Pnt P2 = myEndPoint->Pnt();
|
gp_Pnt P2 = myEndPoint->Pnt();
|
||||||
|
|
||||||
@ -277,11 +254,7 @@ void AIS_Line::ComputeSegmentLine( const Handle(Prs3d_Presentation)& aPresentati
|
|||||||
|
|
||||||
Standard_Real dist = P1.Distance(P2);
|
Standard_Real dist = P1.Distance(P2);
|
||||||
GeomAdaptor_Curve curv(myComponent,0.,dist);
|
GeomAdaptor_Curve curv(myComponent,0.,dist);
|
||||||
Standard_Boolean isPrimitiveArraysEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
|
|
||||||
if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Disable();
|
|
||||||
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
|
StdPrs_Curve::Add(aPresentation,curv,myDrawer);
|
||||||
if(isPrimitiveArraysEnabled) Graphic3d_ArrayOfPrimitives::Enable();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@
|
|||||||
#include <AIS_LocalStatus.hxx>
|
#include <AIS_LocalStatus.hxx>
|
||||||
#include <StdPrs_WFShape.hxx>
|
#include <StdPrs_WFShape.hxx>
|
||||||
#include <Visual3d_TransientManager.hxx>
|
#include <Visual3d_TransientManager.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfTriangles.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Select3D_SensitiveTriangulation.hxx>
|
#include <Select3D_SensitiveTriangulation.hxx>
|
||||||
#include <SelectBasics_SensitiveEntity.hxx>
|
#include <SelectBasics_SensitiveEntity.hxx>
|
||||||
@ -1430,17 +1430,18 @@ void AIS_LocalContext::HilightTriangle(const Standard_Integer Rank,
|
|||||||
{
|
{
|
||||||
static Standard_Integer PrevRank(0);
|
static Standard_Integer PrevRank(0);
|
||||||
if(Rank==PrevRank) return;
|
if(Rank==PrevRank) return;
|
||||||
// PrevRank = Rank;
|
|
||||||
Handle(SelectBasics_SensitiveEntity) SE = myMainVS->Primitive(Rank);
|
Handle(SelectBasics_SensitiveEntity) SE = myMainVS->Primitive(Rank);
|
||||||
if(SE->IsKind(STANDARD_TYPE(Select3D_SensitiveTriangulation))){
|
if(SE->IsKind(STANDARD_TYPE(Select3D_SensitiveTriangulation)))
|
||||||
|
{
|
||||||
Handle(Select3D_SensitiveTriangulation) Tr = *((Handle(Select3D_SensitiveTriangulation)*)&SE);
|
Handle(Select3D_SensitiveTriangulation) Tr = *((Handle(Select3D_SensitiveTriangulation)*)&SE);
|
||||||
gp_Pnt p1,p2,p3 ; Tr->DetectedTriangle(p1,p2,p3);
|
gp_Pnt p1,p2,p3 ; Tr->DetectedTriangle(p1,p2,p3);
|
||||||
static Graphic3d_Array1OfVertex Vtt(1,3);
|
|
||||||
|
|
||||||
Vtt.SetValue(1,Graphic3d_Vertex(p1.X(),p1.Y(),p1.Z()));
|
Handle(Graphic3d_ArrayOfTriangles) aTris = new Graphic3d_ArrayOfTriangles(3);
|
||||||
Vtt.SetValue(2,Graphic3d_Vertex(p2.X(),p2.Y(),p2.Z()));
|
aTris->AddVertex(p1);
|
||||||
Vtt.SetValue(3,Graphic3d_Vertex(p3.X(),p3.Y(),p3.Z()));
|
aTris->AddVertex(p2);
|
||||||
static Handle(Prs3d_Presentation) TriPrs =
|
aTris->AddVertex(p3);
|
||||||
|
|
||||||
|
static Handle(Prs3d_Presentation) TriPrs =
|
||||||
new Prs3d_Presentation(myMainPM->StructureManager());
|
new Prs3d_Presentation(myMainPM->StructureManager());
|
||||||
TriPrs->Clear();
|
TriPrs->Clear();
|
||||||
#ifdef IMP300101
|
#ifdef IMP300101
|
||||||
@ -1448,20 +1449,17 @@ void AIS_LocalContext::HilightTriangle(const Standard_Integer Rank,
|
|||||||
asp->SetColor(myCTX->HilightColor());
|
asp->SetColor(myCTX->HilightColor());
|
||||||
TriPrs->SetShadingAspect(asp);
|
TriPrs->SetShadingAspect(asp);
|
||||||
#endif
|
#endif
|
||||||
Prs3d_Root::CurrentGroup(TriPrs)->Polygon(Vtt);
|
Prs3d_Root::CurrentGroup(TriPrs)->AddPrimitiveArray(aTris);
|
||||||
|
|
||||||
#ifndef IMP300101
|
#ifndef IMP300101
|
||||||
if(view->TransientManagerBeginDraw())
|
if(view->TransientManagerBeginDraw())
|
||||||
Visual3d_TransientManager::EndDraw();
|
Visual3d_TransientManager::EndDraw();
|
||||||
#endif
|
#endif
|
||||||
if(view->TransientManagerBeginDraw()) {
|
if(view->TransientManagerBeginDraw()) {
|
||||||
//P->Exploration();
|
|
||||||
Visual3d_TransientManager::DrawStructure(TriPrs);
|
Visual3d_TransientManager::DrawStructure(TriPrs);
|
||||||
Visual3d_TransientManager::EndDraw();
|
Visual3d_TransientManager::EndDraw();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
#include <ElSLib.hxx>
|
#include <ElSLib.hxx>
|
||||||
|
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfQuadrangles.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Prs3d_Drawer.hxx>
|
#include <Prs3d_Drawer.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
@ -245,58 +245,59 @@ void AIS_Plane::Compute(const Handle(PrsMgr_PresentationManager3d)& ,
|
|||||||
|
|
||||||
ComputeFields();
|
ComputeFields();
|
||||||
aPresentation->SetInfiniteState(myInfiniteState);
|
aPresentation->SetInfiniteState(myInfiniteState);
|
||||||
if (myCurrentMode)
|
myDrawer->PlaneAspect()->EdgesAspect()->SetWidth(myCurrentMode == 0? 1 : 3);
|
||||||
myDrawer->PlaneAspect()->EdgesAspect()->SetWidth(3);
|
|
||||||
else
|
|
||||||
myDrawer->PlaneAspect()->EdgesAspect()->SetWidth(1);
|
|
||||||
if(aMode == 0){
|
|
||||||
if (!myIsXYZPlane){
|
|
||||||
ComputeFrame();
|
|
||||||
const Handle(Geom_Plane)& pl = myComponent;
|
|
||||||
const Handle(Geom_Plane)& thegoodpl = Handle(Geom_Plane)::DownCast
|
|
||||||
(pl->Translated(pl->Location(),myCenter));
|
|
||||||
GeomAdaptor_Surface surf(thegoodpl);
|
|
||||||
StdPrs_Plane::Add(aPresentation,surf,myDrawer);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
DsgPrs_XYZPlanePresentation::Add(aPresentation,myDrawer,myCenter,myPmin,myPmax);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (aMode == 1){
|
|
||||||
if (!myIsXYZPlane){
|
|
||||||
ComputeFrame();
|
|
||||||
Handle(Prs3d_PlaneAspect) theaspect = myDrawer->PlaneAspect();
|
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
|
||||||
gp_Pnt p1;
|
|
||||||
Standard_Real Xmax,Ymax;
|
|
||||||
Xmax = Standard_Real(theaspect->PlaneXLength())/2.;
|
|
||||||
Ymax = Standard_Real(theaspect->PlaneYLength())/2.;
|
|
||||||
static Graphic3d_Array1OfVertex vertices(1,5);
|
|
||||||
TheGroup->SetPrimitivesAspect(myDrawer->ShadingAspect()->Aspect());
|
|
||||||
myComponent->D0(-Xmax,Ymax,p1);
|
|
||||||
vertices(1).SetCoord(p1.X(),p1.Y(),p1.Z());
|
|
||||||
vertices(5).SetCoord(p1.X(),p1.Y(),p1.Z());
|
|
||||||
myComponent->D0(Xmax,Ymax,p1);
|
|
||||||
vertices(2).SetCoord(p1.X(),p1.Y(),p1.Z());
|
|
||||||
myComponent->D0(Xmax,-Ymax,p1);
|
|
||||||
vertices(3).SetCoord(p1.X(),p1.Y(),p1.Z());
|
|
||||||
myComponent->D0(-Xmax,-Ymax,p1);
|
|
||||||
vertices(4).SetCoord(p1.X(),p1.Y(),p1.Z());
|
|
||||||
TheGroup->Polygon(vertices);
|
|
||||||
|
|
||||||
|
switch (aMode)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
if (!myIsXYZPlane)
|
||||||
|
{
|
||||||
|
ComputeFrame();
|
||||||
|
const Handle(Geom_Plane)& pl = myComponent;
|
||||||
|
const Handle(Geom_Plane)& thegoodpl = Handle(Geom_Plane)::DownCast(pl->Translated(pl->Location(),myCenter));
|
||||||
|
GeomAdaptor_Surface surf(thegoodpl);
|
||||||
|
StdPrs_Plane::Add(aPresentation,surf,myDrawer);
|
||||||
}
|
}
|
||||||
else{
|
else
|
||||||
DsgPrs_ShadedPlanePresentation::Add(aPresentation,myDrawer,myCenter,myPmin,myPmax);
|
DsgPrs_XYZPlanePresentation::Add(aPresentation,myDrawer,myCenter,myPmin,myPmax);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
if (!myIsXYZPlane)
|
||||||
|
{
|
||||||
|
ComputeFrame();
|
||||||
|
Handle(Prs3d_PlaneAspect) theaspect = myDrawer->PlaneAspect();
|
||||||
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
||||||
|
TheGroup->SetPrimitivesAspect(myDrawer->ShadingAspect()->Aspect());
|
||||||
|
gp_Pnt p1;
|
||||||
|
const Standard_Real Xmax = 0.5*Standard_Real(theaspect->PlaneXLength());
|
||||||
|
const Standard_Real Ymax = 0.5*Standard_Real(theaspect->PlaneYLength());
|
||||||
|
|
||||||
|
Handle(Graphic3d_ArrayOfQuadrangles) aQuads = new Graphic3d_ArrayOfQuadrangles(4);
|
||||||
|
|
||||||
|
myComponent->D0(-Xmax,Ymax,p1);
|
||||||
|
aQuads->AddVertex(p1);
|
||||||
|
myComponent->D0(Xmax,Ymax,p1);
|
||||||
|
aQuads->AddVertex(p1);
|
||||||
|
myComponent->D0(Xmax,-Ymax,p1);
|
||||||
|
aQuads->AddVertex(p1);
|
||||||
|
myComponent->D0(-Xmax,-Ymax,p1);
|
||||||
|
aQuads->AddVertex(p1);
|
||||||
|
|
||||||
|
TheGroup->AddPrimitiveArray(aQuads);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
DsgPrs_ShadedPlanePresentation::Add(aPresentation,myDrawer,myCenter,myPmin,myPmax);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIS_Plane::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
|
void AIS_Plane::Compute(const Handle_Prs3d_Projector& aProjector, const Handle_Geom_Transformation& aTransformation, const Handle_Prs3d_Presentation& aPresentation)
|
||||||
{
|
{
|
||||||
// Standard_NotImplemented::Raise("AIS_Plane::Compute(const Handle_Prs3d_Projector&, const Handle_Geom_Transformation&, const Handle_Prs3d_Presentation&)");
|
PrsMgr_PresentableObject::Compute(aProjector, aTransformation, aPresentation);
|
||||||
PrsMgr_PresentableObject::Compute( aProjector , aTransformation , aPresentation) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
@ -19,8 +19,7 @@
|
|||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#define GER61351 //GG_171199 Enable to set an object RGB color
|
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||||
// instead a restricted object NameOfColor.
|
|
||||||
|
|
||||||
#define OCC218 //SAV using DsgPrs_XYZAxisPresentation to draw axes.
|
#define OCC218 //SAV using DsgPrs_XYZAxisPresentation to draw axes.
|
||||||
// + X/YAxis() returns AIS_Line instead of AIS_Axis
|
// + X/YAxis() returns AIS_Line instead of AIS_Axis
|
||||||
@ -280,13 +279,11 @@ void AIS_PlaneTrihedron::ComputeSelection(const Handle(SelectMgr_Selection)& aSe
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AIS_PlaneTrihedron::SetColor(const Quantity_NameOfColor aCol)
|
void AIS_PlaneTrihedron::SetColor(const Quantity_NameOfColor aCol)
|
||||||
#ifdef GER61351
|
|
||||||
{
|
{
|
||||||
SetColor(Quantity_Color(aCol));
|
SetColor(Quantity_Color(aCol));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIS_PlaneTrihedron::SetColor(const Quantity_Color &aCol)
|
void AIS_PlaneTrihedron::SetColor(const Quantity_Color &aCol)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
hasOwnColor=Standard_True;
|
hasOwnColor=Standard_True;
|
||||||
myOwnColor = aCol;
|
myOwnColor = aCol;
|
||||||
|
@ -19,14 +19,12 @@
|
|||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#define GER61351 //GG_171199 Enable to set an object RGB color
|
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||||
// instead a restricted object NameOfColor.
|
|
||||||
|
|
||||||
#define BUC60915 //GG 05/06/01 Enable to compute the requested arrow size
|
#define BUC60915 //GG 05/06/01 Enable to compute the requested arrow size
|
||||||
// if any in all dimensions.
|
// if any in all dimensions.
|
||||||
|
|
||||||
#include <AIS.hxx>
|
#include <AIS.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
|
|
||||||
#include <AIS_Relation.ixx>
|
#include <AIS_Relation.ixx>
|
||||||
@ -222,13 +220,11 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void AIS_Relation::SetColor(const Quantity_NameOfColor aCol)
|
void AIS_Relation::SetColor(const Quantity_NameOfColor aCol)
|
||||||
#ifdef GER61351
|
|
||||||
{
|
{
|
||||||
SetColor(Quantity_Color(aCol));
|
SetColor(Quantity_Color(aCol));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIS_Relation::SetColor(const Quantity_Color &aCol)
|
void AIS_Relation::SetColor(const Quantity_Color &aCol)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
if(hasOwnColor && myOwnColor==aCol) return;
|
if(hasOwnColor && myOwnColor==aCol) return;
|
||||||
|
|
||||||
@ -268,13 +264,9 @@ void AIS_Relation::UnsetColor()
|
|||||||
if (!hasOwnColor) return;
|
if (!hasOwnColor) return;
|
||||||
hasOwnColor = Standard_False;
|
hasOwnColor = Standard_False;
|
||||||
const Handle(Prs3d_LineAspect)& LA = myDrawer->LineAspect();
|
const Handle(Prs3d_LineAspect)& LA = myDrawer->LineAspect();
|
||||||
#ifdef GER61351
|
|
||||||
Quantity_Color CC;
|
Quantity_Color CC;
|
||||||
AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line,CC);
|
||||||
LA->SetColor(CC);
|
LA->SetColor(CC);
|
||||||
#else
|
|
||||||
LA->SetColor(AIS_GraphicTool::GetLineColor(myDrawer->Link(),AIS_TOA_Line));
|
|
||||||
#endif
|
|
||||||
myDrawer->AngleAspect()->SetLineAspect(LA);
|
myDrawer->AngleAspect()->SetLineAspect(LA);
|
||||||
myDrawer->LengthAspect()->SetLineAspect(LA);
|
myDrawer->LengthAspect()->SetLineAspect(LA);
|
||||||
myDrawer->SetTextAspect(myDrawer->Link()->TextAspect());
|
myDrawer->SetTextAspect(myDrawer->Link()->TextAspect());
|
||||||
|
@ -44,8 +44,7 @@
|
|||||||
#include <Graphic3d_AspectText3d.hxx>
|
#include <Graphic3d_AspectText3d.hxx>
|
||||||
#include <Graphic3d_AspectMarker3d.hxx>
|
#include <Graphic3d_AspectMarker3d.hxx>
|
||||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
|
||||||
#include <Graphic3d_MaterialAspect.hxx>
|
#include <Graphic3d_MaterialAspect.hxx>
|
||||||
|
|
||||||
#include <Prs3d_Presentation.hxx>
|
#include <Prs3d_Presentation.hxx>
|
||||||
@ -104,24 +103,18 @@ void AIS_Shape::DisplayBox(const Handle(Prs3d_Presentation)& aPrs,
|
|||||||
const Bnd_Box& B,
|
const Bnd_Box& B,
|
||||||
const Handle(Prs3d_Drawer)& aDrawer)
|
const Handle(Prs3d_Drawer)& aDrawer)
|
||||||
{
|
{
|
||||||
Standard_Real X[2],Y[2],Z[2];
|
static const Standard_Integer Indx[][3] =
|
||||||
Standard_Integer Indx [16] ;
|
{ { 0, 0, 0 }, { 1, 0, 0 }, { 1, 0, 1 }, { 0, 0, 1 },
|
||||||
|
{ 0, 1, 1 }, { 1, 1, 1 }, { 1, 1, 0 }, { 0, 1, 0 },
|
||||||
|
{ 0, 0, 0 }, { 0, 0, 1 }, { 1, 0, 1 }, { 1, 1, 1 },
|
||||||
|
{ 0, 1, 1 }, { 0, 1, 0 }, { 1, 1, 0 }, { 1, 0, 0 } };
|
||||||
|
|
||||||
if ( B.IsVoid() )
|
if ( B.IsVoid() )
|
||||||
return; // nothing to show
|
return; // nothing to show
|
||||||
|
|
||||||
Indx [0]=1;Indx [1]=2;Indx [2]=4;Indx [3]=3;
|
Standard_Real X[2],Y[2],Z[2];
|
||||||
Indx [4]=5;Indx [5]=6;Indx [6]=8;Indx [7]=7;
|
|
||||||
Indx [8]=1;Indx [9]=3;Indx [10]=7;Indx [11]=5;
|
|
||||||
Indx [12]=2;Indx [13]=4;Indx [14]=8;Indx [15]=6;
|
|
||||||
B.Get(X[0], Y[0], Z[0], X[1], Y[1], Z[1]);
|
B.Get(X[0], Y[0], Z[0], X[1], Y[1], Z[1]);
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,8);
|
|
||||||
Standard_Integer Rank(0);
|
|
||||||
for(Standard_Integer k=0;k<=1;k++)
|
|
||||||
for(Standard_Integer j=0;j<=1;j++)
|
|
||||||
for(Standard_Integer i=0;i<=1;i++)
|
|
||||||
V(++Rank) = Graphic3d_Vertex(X[i],Y[j],Z[k]);
|
|
||||||
|
|
||||||
Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPrs);
|
Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPrs);
|
||||||
Quantity_Color Q;
|
Quantity_Color Q;
|
||||||
Aspect_TypeOfLine A;
|
Aspect_TypeOfLine A;
|
||||||
@ -130,16 +123,11 @@ void AIS_Shape::DisplayBox(const Handle(Prs3d_Presentation)& aPrs,
|
|||||||
|
|
||||||
G->SetGroupPrimitivesAspect(new Graphic3d_AspectLine3d(Q,Aspect_TOL_DOTDASH,W));
|
G->SetGroupPrimitivesAspect(new Graphic3d_AspectLine3d(Q,Aspect_TOL_DOTDASH,W));
|
||||||
|
|
||||||
G->BeginPrimitives();Standard_Integer I,J;
|
Handle(Graphic3d_ArrayOfPolylines) aPolyline = new Graphic3d_ArrayOfPolylines(16);
|
||||||
Graphic3d_Array1OfVertex VVV (1,5);
|
Standard_Integer i(0);
|
||||||
for(I=1;I<=4;I++){
|
for(;i<16;i++)
|
||||||
for(J=1;J<=4;J++){
|
aPolyline->AddVertex(X[Indx[i][0]],Y[Indx[i][1]],Z[Indx[i][2]]);
|
||||||
VVV.SetValue(J,V(Indx[J+4*I-5]));
|
G->AddPrimitiveArray(aPolyline);
|
||||||
}
|
|
||||||
VVV.SetValue(5,VVV(1));
|
|
||||||
G->Polyline(VVV);
|
|
||||||
}
|
|
||||||
G->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Standard_Boolean IsInList(const TColStd_ListOfInteger& LL, const Standard_Integer aMode)
|
static Standard_Boolean IsInList(const TColStd_ListOfInteger& LL, const Standard_Integer aMode)
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||||
#include <Graphic3d_ArrayOfTriangles.hxx>
|
#include <Graphic3d_ArrayOfTriangles.hxx>
|
||||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
|
||||||
|
|
||||||
|
|
||||||
IMPLEMENT_STANDARD_HANDLE(AIS_Triangulation, AIS_InteractiveObject)
|
IMPLEMENT_STANDARD_HANDLE(AIS_Triangulation, AIS_InteractiveObject)
|
||||||
@ -66,7 +65,7 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& aPre
|
|||||||
if( myFlagColor == 1 )
|
if( myFlagColor == 1 )
|
||||||
hasVColors = Standard_True;
|
hasVColors = Standard_True;
|
||||||
|
|
||||||
Handle(Graphic3d_ArrayOfTriangles) array =
|
Handle(Graphic3d_ArrayOfTriangles) anArray =
|
||||||
new Graphic3d_ArrayOfTriangles ( myNbNodes, //maxVertexs
|
new Graphic3d_ArrayOfTriangles ( myNbNodes, //maxVertexs
|
||||||
myNbTriangles * 3,//maxEdges
|
myNbTriangles * 3,//maxEdges
|
||||||
hasVNormals, //hasVNormals
|
hasVNormals, //hasVNormals
|
||||||
@ -83,24 +82,22 @@ void AIS_Triangulation::Compute(const Handle(PrsMgr_PresentationManager3d)& aPre
|
|||||||
Standard_Real ambient = aspect->FrontMaterial().Ambient();
|
Standard_Real ambient = aspect->FrontMaterial().Ambient();
|
||||||
for ( i = nodes.Lower(); i<= nodes.Upper(); i++ ){
|
for ( i = nodes.Lower(); i<= nodes.Upper(); i++ ){
|
||||||
if( myFlagColor == 1 )
|
if( myFlagColor == 1 )
|
||||||
array->AddVertex( nodes(i), AttenuateColor(myColor->Value(i),ambient));
|
anArray->AddVertex( nodes(i), AttenuateColor(myColor->Value(i),ambient));
|
||||||
if( myFlagColor == 0 )
|
if( myFlagColor == 0 )
|
||||||
array->AddVertex( nodes(i) );
|
anArray->AddVertex( nodes(i) );
|
||||||
j = (i - nodes.Lower()) * 3;
|
j = (i - nodes.Lower()) * 3;
|
||||||
array->SetVertexNormal(i, normals(j+1), normals(j+2), normals(j+3));
|
anArray->SetVertexNormal(i, normals(j+1), normals(j+2), normals(j+3));
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer indexTriangle[3] = {0,0,0};
|
Standard_Integer indexTriangle[3] = {0,0,0};
|
||||||
for ( i = triangles.Lower(); i<= triangles.Upper(); i++ ) {
|
for ( i = triangles.Lower(); i<= triangles.Upper(); i++ ) {
|
||||||
triangles(i).Get(indexTriangle[0], indexTriangle[1], indexTriangle[2]);
|
triangles(i).Get(indexTriangle[0], indexTriangle[1], indexTriangle[2]);
|
||||||
array->AddEdge(indexTriangle[0]);
|
anArray->AddEdge(indexTriangle[0]);
|
||||||
array->AddEdge(indexTriangle[1]);
|
anArray->AddEdge(indexTriangle[1]);
|
||||||
array->AddEdge(indexTriangle[2]);
|
anArray->AddEdge(indexTriangle[2]);
|
||||||
}
|
}
|
||||||
TheGroup->SetPrimitivesAspect(aspect);
|
TheGroup->SetPrimitivesAspect(aspect);
|
||||||
TheGroup->BeginPrimitives();
|
TheGroup->AddPrimitiveArray(anArray);
|
||||||
TheGroup->AddPrimitiveArray(array);
|
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,8 +19,7 @@
|
|||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#define GER61351 //GG_171199 Enable to set an object RGB color
|
//GER61351 //GG_171199 Enable to set an object RGB color instead a restricted object NameOfColor.
|
||||||
// instead a restricted object NameOfColor.
|
|
||||||
|
|
||||||
#define IMP120100 // GG Add SetTextColor() and SetArrowColor() methods
|
#define IMP120100 // GG Add SetTextColor() and SetArrowColor() methods
|
||||||
|
|
||||||
@ -430,13 +429,11 @@ void AIS_Trihedron::ComputeSelection(const Handle(SelectMgr_Selection)& aSelecti
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void AIS_Trihedron::SetColor(const Quantity_NameOfColor aCol)
|
void AIS_Trihedron::SetColor(const Quantity_NameOfColor aCol)
|
||||||
#ifdef GER61351
|
|
||||||
{
|
{
|
||||||
SetColor(Quantity_Color(aCol));
|
SetColor(Quantity_Color(aCol));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AIS_Trihedron::SetColor(const Quantity_Color &aCol)
|
void AIS_Trihedron::SetColor(const Quantity_Color &aCol)
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
hasOwnColor=Standard_True;
|
hasOwnColor=Standard_True;
|
||||||
myOwnColor = aCol;
|
myOwnColor = aCol;
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,7 @@
|
|||||||
#include <DsgPrs_Chamf2dPresentation.ixx>
|
#include <DsgPrs_Chamf2dPresentation.ixx>
|
||||||
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
#include <Prs3d_Arrow.hxx>
|
#include <Prs3d_Arrow.hxx>
|
||||||
#include <Prs3d_ArrowAspect.hxx>
|
#include <Prs3d_ArrowAspect.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
@ -44,25 +44,17 @@ void DsgPrs_Chamf2dPresentation::Add(
|
|||||||
{
|
{
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
V(1).SetCoord(aPntAttach.X(),aPntAttach.Y(),aPntAttach.Z());
|
aPrims->AddVertex(aPntAttach);
|
||||||
|
aPrims->AddVertex(aPntEnd);
|
||||||
V(2).SetCoord(aPntEnd.X(),aPntEnd.Y(),aPntEnd.Z());
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
gp_Dir ArrowDir(aPntAttach.XYZ()-aPntEnd.XYZ());
|
gp_Dir ArrowDir(aPntAttach.XYZ()-aPntEnd.XYZ());
|
||||||
Prs3d_Arrow::Draw(aPresentation,
|
Prs3d_Arrow::Draw(aPresentation,aPntAttach,ArrowDir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
|
||||||
aPntAttach,
|
|
||||||
ArrowDir,
|
|
||||||
LA->Arrow1Aspect()->Angle(),
|
|
||||||
LA->Arrow1Aspect()->Length());
|
|
||||||
|
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntEnd);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntEnd);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -81,24 +73,18 @@ void DsgPrs_Chamf2dPresentation::Add(
|
|||||||
{
|
{
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
V(1).SetCoord(aPntAttach.X(),aPntAttach.Y(),aPntAttach.Z());
|
aPrims->AddVertex(aPntAttach);
|
||||||
|
aPrims->AddVertex(aPntEnd);
|
||||||
V(2).SetCoord(aPntEnd.X(),aPntEnd.Y(),aPntEnd.Z());
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntEnd);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntEnd);
|
||||||
|
|
||||||
gp_Dir ArrowDir(aPntAttach.XYZ()-aPntEnd.XYZ());
|
gp_Dir ArrowDir(aPntAttach.XYZ()-aPntEnd.XYZ());
|
||||||
|
|
||||||
gp_Dir ArrowDir1 = ArrowDir;
|
gp_Dir ArrowDir1 = ArrowDir;
|
||||||
ArrowDir1.Reverse();
|
ArrowDir1.Reverse();
|
||||||
|
|
||||||
DsgPrs::ComputeSymbol(aPresentation,LA,aPntEnd,aPntAttach,ArrowDir1,ArrowDir,ArrowPrs);
|
DsgPrs::ComputeSymbol(aPresentation,LA,aPntEnd,aPntAttach,ArrowDir1,ArrowDir,ArrowPrs);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <DsgPrs_ConcentricPresentation.ixx>
|
#include <DsgPrs_ConcentricPresentation.ixx>
|
||||||
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Prs3d_LengthAspect.hxx>
|
#include <Prs3d_LengthAspect.hxx>
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
@ -47,51 +47,43 @@ void DsgPrs_ConcentricPresentation::Add(
|
|||||||
|
|
||||||
//Creation et discretisation du plus gros cercle
|
//Creation et discretisation du plus gros cercle
|
||||||
gp_Circ Circ(gp_Ax2(aCenter,aNorm), aRadius);
|
gp_Circ Circ(gp_Ax2(aCenter,aNorm), aRadius);
|
||||||
Standard_Integer nbp = 50;
|
const Standard_Integer nbp = 50;
|
||||||
Standard_Real dteta = (2 * M_PI)/nbp;
|
const Standard_Real dteta = (2. * M_PI)/nbp;
|
||||||
Graphic3d_Array1OfVertex V(1,nbp+1);
|
|
||||||
gp_Pnt ptcur;
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
Standard_Real ucur = 0;
|
|
||||||
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(2*nbp+6,4);
|
||||||
|
|
||||||
|
gp_Pnt pt1 = ElCLib::Value(0., Circ);
|
||||||
|
aPrims->AddBound(nbp+1);
|
||||||
|
aPrims->AddVertex(pt1);
|
||||||
|
Standard_Real ucur = dteta;
|
||||||
Standard_Integer i ;
|
Standard_Integer i ;
|
||||||
for ( i = 1; i<=nbp; i++) {
|
for (i = 2; i<=nbp; i++, ucur += dteta)
|
||||||
ptcur = ElCLib::Value(ucur, Circ);
|
aPrims->AddVertex(ElCLib::Value(ucur, Circ));
|
||||||
V(i).SetCoord(ptcur.X(), ptcur.Y(),ptcur.Z());
|
aPrims->AddVertex(pt1);
|
||||||
ucur = ucur + dteta;
|
|
||||||
}
|
|
||||||
V(nbp+1).SetCoord( V(1).X(), V(1).Y(), V(1).Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)
|
|
||||||
->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
//Creation et discretisation du plus petit cercle
|
//Creation et discretisation du plus petit cercle
|
||||||
Circ.SetRadius(aRadius/2);
|
Circ.SetRadius(0.5*aRadius);
|
||||||
ucur = 0;
|
pt1 = ElCLib::Value(0., Circ);
|
||||||
for ( i = 1; i<=nbp; i++) {
|
aPrims->AddBound(nbp+1);
|
||||||
ptcur = ElCLib::Value(ucur, Circ);
|
aPrims->AddVertex(pt1);
|
||||||
V(i).SetCoord(ptcur.X(), ptcur.Y(),ptcur.Z());
|
ucur = dteta;
|
||||||
ucur = ucur + dteta;
|
for (i = 2; i<=nbp; i++, ucur += dteta)
|
||||||
}
|
aPrims->AddVertex(ElCLib::Value(ucur, Circ));
|
||||||
V(nbp+1).SetCoord( V(1).X(), V(1).Y(), V(1).Z());
|
aPrims->AddVertex(pt1);
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)
|
|
||||||
->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
//Creation de la croix
|
//Creation de la croix
|
||||||
//1er segment
|
//1er segment
|
||||||
gp_Dir vecnorm(aPoint.XYZ() - aCenter.XYZ() );
|
gp_Dir vecnorm(aPoint.XYZ() - aCenter.XYZ());
|
||||||
gp_Vec vec(vecnorm);
|
gp_Vec vec(vecnorm);
|
||||||
vec.Multiply(aRadius);
|
vec.Multiply(aRadius);
|
||||||
gp_Pnt p1 = aCenter.Translated(vec);
|
gp_Pnt p1 = aCenter.Translated(vec);
|
||||||
gp_Pnt p2 = aCenter.Translated(-vec);
|
gp_Pnt p2 = aCenter.Translated(-vec);
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddBound(2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->
|
aPrims->AddVertex(p1);
|
||||||
SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
aPrims->AddVertex(p2);
|
||||||
Graphic3d_Array1OfVertex VExt(1,2);
|
|
||||||
VExt(1).SetCoord(p1.X(), p1.Y(), p1.Z());
|
|
||||||
VExt(2).SetCoord(p2.X(), p2.Y(), p2.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VExt);
|
|
||||||
|
|
||||||
//2ieme segment
|
//2ieme segment
|
||||||
vec.Cross(aNorm);
|
vec.Cross(aNorm);
|
||||||
@ -100,12 +92,10 @@ void DsgPrs_ConcentricPresentation::Add(
|
|||||||
vec.Multiply(aRadius);
|
vec.Multiply(aRadius);
|
||||||
p1 = aCenter.Translated(vec);
|
p1 = aCenter.Translated(vec);
|
||||||
p2 = aCenter.Translated(-vec);
|
p2 = aCenter.Translated(-vec);
|
||||||
VExt(1).SetCoord(p1.X(), p1.Y(), p1.Z());
|
|
||||||
VExt(2).SetCoord(p2.X(), p2.Y(), p2.Z());
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddBound(2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->
|
aPrims->AddVertex(p1);
|
||||||
SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
aPrims->AddVertex(p2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VExt);
|
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include <Prs3d_ArrowAspect.hxx>
|
#include <Prs3d_ArrowAspect.hxx>
|
||||||
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
|
||||||
#include <gp_Dir.hxx>
|
#include <gp_Dir.hxx>
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
@ -60,8 +60,6 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
const DsgPrs_ArrowSide ArrowPrs,
|
const DsgPrs_ArrowSide ArrowPrs,
|
||||||
const Standard_Boolean IsDiamSymbol )
|
const Standard_Boolean IsDiamSymbol )
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
@ -69,32 +67,26 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
gp_Pnt ptoncirc = ElCLib::Value (parat, aCircle);
|
gp_Pnt ptoncirc = ElCLib::Value (parat, aCircle);
|
||||||
|
|
||||||
// sideline
|
// sideline
|
||||||
|
|
||||||
gp_Pnt center = aCircle.Location();
|
gp_Pnt center = aCircle.Location();
|
||||||
gp_Vec vecrap (ptoncirc,center);
|
gp_Vec vecrap (ptoncirc,center);
|
||||||
|
|
||||||
Standard_Real dist = center.Distance(AttachmentPoint);
|
Standard_Real dist = center.Distance(AttachmentPoint);
|
||||||
Standard_Real aRadius = aCircle.Radius();
|
Standard_Real aRadius = aCircle.Radius();
|
||||||
Standard_Boolean inside = Standard_False;
|
Standard_Boolean inside = (dist < aRadius);
|
||||||
|
|
||||||
gp_Pnt pt1 = AttachmentPoint;
|
gp_Pnt pt1 = AttachmentPoint;
|
||||||
if (dist < aRadius) {
|
if (inside) {
|
||||||
pt1 = ptoncirc;
|
pt1 = ptoncirc;
|
||||||
dist = aRadius;
|
dist = aRadius;
|
||||||
inside = Standard_True;
|
|
||||||
}
|
}
|
||||||
vecrap.Normalize();
|
vecrap.Normalize();
|
||||||
vecrap *= (dist+aRadius);
|
vecrap *= (dist+aRadius);
|
||||||
gp_Pnt OppositePoint = pt1.Translated(vecrap);
|
gp_Pnt OppositePoint = pt1.Translated(vecrap);
|
||||||
|
|
||||||
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
aPrims->AddVertex(pt1);
|
||||||
Quantity_Length X,Y,Z;
|
aPrims->AddVertex(OppositePoint);
|
||||||
pt1.Coord(X,Y,Z);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
OppositePoint.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// value
|
// value
|
||||||
TCollection_ExtendedString Text = aText;
|
TCollection_ExtendedString Text = aText;
|
||||||
@ -103,11 +95,9 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
Prs3d_Text::Draw(aPresentation, LA->TextAspect(), Text, AttachmentPoint);
|
Prs3d_Text::Draw(aPresentation, LA->TextAspect(), Text, AttachmentPoint);
|
||||||
|
|
||||||
// arrows
|
// arrows
|
||||||
|
|
||||||
gp_Dir arrdir (vecrap);
|
gp_Dir arrdir (vecrap);
|
||||||
if (inside) arrdir.Reverse();
|
if (inside) arrdir.Reverse();
|
||||||
|
|
||||||
|
|
||||||
gp_Vec vecrap2 = vecrap;
|
gp_Vec vecrap2 = vecrap;
|
||||||
gp_Pnt ptoncirc2 = ptoncirc;
|
gp_Pnt ptoncirc2 = ptoncirc;
|
||||||
gp_Dir arrdir2 = arrdir;
|
gp_Dir arrdir2 = arrdir;
|
||||||
@ -128,7 +118,7 @@ static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar,
|
|||||||
if(lpar > fpar)
|
if(lpar > fpar)
|
||||||
return ((para >= fpar) && (para <= lpar));
|
return ((para >= fpar) && (para <= lpar));
|
||||||
else { // fpar > lpar
|
else { // fpar > lpar
|
||||||
Standard_Real delta = 2*M_PI-fpar;
|
Standard_Real delta = 2.*M_PI-fpar;
|
||||||
Standard_Real lp, par, fp;
|
Standard_Real lp, par, fp;
|
||||||
lp = lpar + delta;
|
lp = lpar + delta;
|
||||||
par = para + delta;
|
par = para + delta;
|
||||||
@ -137,7 +127,6 @@ static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar,
|
|||||||
fp = 0.;
|
fp = 0.;
|
||||||
return ((par >= fp) && (par <= lp));
|
return ((par >= fp) && (par <= lp));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (para >= (fpar+2*M_PI)) return Standard_True;
|
if (para >= (fpar+2*M_PI)) return Standard_True;
|
||||||
if (para <= lpar) return Standard_True;
|
if (para <= lpar) return Standard_True;
|
||||||
@ -162,16 +151,14 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
{
|
{
|
||||||
Standard_Real fpara = uFirst;
|
Standard_Real fpara = uFirst;
|
||||||
Standard_Real lpara = uLast;
|
Standard_Real lpara = uLast;
|
||||||
while (lpara > 2*M_PI) {
|
while (lpara > 2.*M_PI) {
|
||||||
fpara -= 2*M_PI;
|
fpara -= 2.*M_PI;
|
||||||
lpara -= 2*M_PI;
|
lpara -= 2.*M_PI;
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
// Handle(Prs3d_TextAspect) TA = aDrawer->TextAspect();
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
// AspectText3d from Graphic3d
|
Standard_Real parEndOfArrow = ElCLib::Parameter(aCircle,AttachmentPoint);
|
||||||
Standard_Real parEndOfArrow = ElCLib::Parameter(aCircle,AttachmentPoint); //
|
|
||||||
gp_Pnt EndOfArrow;
|
gp_Pnt EndOfArrow;
|
||||||
gp_Pnt DrawPosition = AttachmentPoint;// point of attachment
|
gp_Pnt DrawPosition = AttachmentPoint;// point of attachment
|
||||||
Standard_Boolean otherside = Standard_False;
|
Standard_Boolean otherside = Standard_False;
|
||||||
@ -194,34 +181,26 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
gp_Lin L1( Center, dir1 );
|
gp_Lin L1( Center, dir1 );
|
||||||
gp_Lin L2( Center, dir2 );
|
gp_Lin L2( Center, dir2 );
|
||||||
if(L1.Distance(AttachmentPoint) < L2.Distance(AttachmentPoint))
|
if(L1.Distance(AttachmentPoint) < L2.Distance(AttachmentPoint))
|
||||||
{
|
{
|
||||||
EndOfArrow = FirstPoint; //***
|
EndOfArrow = FirstPoint; //***
|
||||||
DrawPosition = ElCLib::Value(ElCLib::Parameter( L1, AttachmentPoint ), L1);
|
DrawPosition = ElCLib::Value(ElCLib::Parameter( L1, AttachmentPoint ), L1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EndOfArrow = SecondPoint; //***
|
EndOfArrow = SecondPoint; //***
|
||||||
DrawPosition = ElCLib::Value(ElCLib::Parameter( L2, AttachmentPoint ), L2);
|
DrawPosition = ElCLib::Value(ElCLib::Parameter( L2, AttachmentPoint ), L2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// EndOfArrow = ElCLib::Value(parEndOfArrow, aCircle);
|
|
||||||
// DrawPosition = AttachmentPoint;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
EndOfArrow = ElCLib::Value(parEndOfArrow, aCircle);
|
EndOfArrow = ElCLib::Value(parEndOfArrow, aCircle);
|
||||||
DrawPosition = AttachmentPoint;
|
DrawPosition = AttachmentPoint;
|
||||||
}
|
}
|
||||||
Graphic3d_Array1OfVertex Vrap(1,2);
|
|
||||||
|
|
||||||
Quantity_Length X,Y,Z;
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(DrawPosition);
|
||||||
DrawPosition.Coord(X,Y,Z);
|
aPrims->AddVertex(EndOfArrow);
|
||||||
Vrap(1).SetCoord(X,Y,Z);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
EndOfArrow.Coord(X,Y,Z);
|
|
||||||
Vrap(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrap);
|
|
||||||
|
|
||||||
// text
|
// text
|
||||||
TCollection_ExtendedString Text = aText;
|
TCollection_ExtendedString Text = aText;
|
||||||
@ -229,8 +208,7 @@ void DsgPrs_DiameterPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
Text = TCollection_ExtendedString("\330 ") + Text;// => \330 | \370?
|
Text = TCollection_ExtendedString("\330 ") + Text;// => \330 | \370?
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),Text,DrawPosition);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),Text,DrawPosition);
|
||||||
|
|
||||||
// Add presentation of arrow
|
// Add presentation of arrow
|
||||||
gp_Dir DirOfArrow(gp_Vec(DrawPosition, EndOfArrow).XYZ());
|
gp_Dir DirOfArrow(gp_Vec(DrawPosition, EndOfArrow).XYZ());
|
||||||
DsgPrs::ComputeSymbol(aPresentation, LA, EndOfArrow, EndOfArrow, DirOfArrow, DirOfArrow, ArrowPrs);
|
DsgPrs::ComputeSymbol(aPresentation, LA, EndOfArrow, EndOfArrow, DirOfArrow, DirOfArrow, ArrowPrs);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_EllipseRadiusPresentation.ixx>
|
#include <DsgPrs_EllipseRadiusPresentation.ixx>
|
||||||
|
|
||||||
#include <gp_Lin.hxx>
|
#include <gp_Lin.hxx>
|
||||||
@ -27,7 +25,8 @@
|
|||||||
#include <gp_Elips.hxx>
|
#include <gp_Elips.hxx>
|
||||||
#include <ElCLib.hxx>
|
#include <ElCLib.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Prs3d_LengthAspect.hxx>
|
#include <Prs3d_LengthAspect.hxx>
|
||||||
#include <Prs3d_Arrow.hxx>
|
#include <Prs3d_Arrow.hxx>
|
||||||
#include <Prs3d_ArrowAspect.hxx>
|
#include <Prs3d_ArrowAspect.hxx>
|
||||||
@ -51,6 +50,7 @@
|
|||||||
#include <Geom_TrimmedCurve.hxx>
|
#include <Geom_TrimmedCurve.hxx>
|
||||||
#include <GeomAPI_ExtremaCurveCurve.hxx>
|
#include <GeomAPI_ExtremaCurveCurve.hxx>
|
||||||
#include <Geom_OffsetCurve.hxx>
|
#include <Geom_OffsetCurve.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Add
|
//function : Add
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -60,49 +60,34 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
|
|||||||
const Handle(Prs3d_Drawer)& aDrawer,
|
const Handle(Prs3d_Drawer)& aDrawer,
|
||||||
const Standard_Real theval,
|
const Standard_Real theval,
|
||||||
const TCollection_ExtendedString & aText,
|
const TCollection_ExtendedString & aText,
|
||||||
// const gp_Elips & anEllipse,
|
|
||||||
const gp_Pnt & aPosition,
|
const gp_Pnt & aPosition,
|
||||||
const gp_Pnt & anEndOfArrow,
|
const gp_Pnt & anEndOfArrow,
|
||||||
const gp_Pnt & aCenter,
|
const gp_Pnt & aCenter,
|
||||||
const Standard_Boolean IsMaxRadius,
|
const Standard_Boolean IsMaxRadius,
|
||||||
const DsgPrs_ArrowSide ArrowPrs)
|
const DsgPrs_ArrowSide ArrowPrs)
|
||||||
{
|
{
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
Standard_Boolean inside = Standard_False;
|
const Standard_Real dist = aCenter.Distance( aPosition );
|
||||||
// gp_Pnt EndPoint, EndOfArrow;
|
const Standard_Boolean inside = ( dist <= theval );
|
||||||
gp_Pnt EndPoint;
|
gp_Pnt EndPoint(inside? anEndOfArrow : aPosition);
|
||||||
Standard_Real dist = aCenter.Distance( aPosition );
|
|
||||||
if( dist > theval ) EndPoint = aPosition;
|
|
||||||
else {
|
|
||||||
EndPoint = anEndOfArrow;
|
|
||||||
inside = Standard_True;
|
|
||||||
}
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
Quantity_Length X,Y,Z;
|
|
||||||
aCenter.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
EndPoint.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// value
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
TCollection_ExtendedString Text;
|
aPrims->AddVertex(aCenter);
|
||||||
if(IsMaxRadius)
|
aPrims->AddVertex(EndPoint);
|
||||||
Text = TCollection_ExtendedString("a = ");
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
else
|
|
||||||
Text = TCollection_ExtendedString("b = ");
|
// value
|
||||||
Text += aText;
|
TCollection_ExtendedString Text(IsMaxRadius? "a = " : "b = ");
|
||||||
|
Text += aText;
|
||||||
Prs3d_Text::Draw(aPresentation, LA->TextAspect(), Text, aPosition );
|
Prs3d_Text::Draw(aPresentation, LA->TextAspect(), Text, aPosition );
|
||||||
|
|
||||||
// arrows
|
// arrows
|
||||||
gp_Dir arrdir( gp_Vec( aCenter, anEndOfArrow));
|
gp_Dir arrdir( gp_Vec( aCenter, anEndOfArrow));
|
||||||
if (!inside) arrdir.Reverse();
|
if (!inside) arrdir.Reverse();
|
||||||
|
|
||||||
DsgPrs::ComputeSymbol(aPresentation, LA, anEndOfArrow, anEndOfArrow, arrdir, arrdir, ArrowPrs );
|
DsgPrs::ComputeSymbol(aPresentation, LA, anEndOfArrow, anEndOfArrow, arrdir, arrdir, ArrowPrs );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -123,40 +108,30 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
|
|||||||
const Standard_Boolean IsMaxRadius,
|
const Standard_Boolean IsMaxRadius,
|
||||||
const DsgPrs_ArrowSide ArrowPrs)
|
const DsgPrs_ArrowSide ArrowPrs)
|
||||||
{
|
{
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
if(!IsInDomain)
|
if(!IsInDomain)
|
||||||
{
|
{
|
||||||
Standard_Real parFirst;
|
const Standard_Real uLast = ElCLib::Parameter ( anEllipse, anEndOfArrow );
|
||||||
Standard_Real uLast = ElCLib::Parameter ( anEllipse, anEndOfArrow );
|
const Standard_Real Alpha = DsgPrs::DistanceFromApex(anEllipse, anEndOfArrow, uFirst);//length of ellipse arc
|
||||||
Standard_Real Alpha = DsgPrs::DistanceFromApex(anEllipse, anEndOfArrow, uFirst);//length of ellipse arc
|
gp_Vec Vapex(aCenter, ElCLib::Value( uLast, anEllipse )) ;
|
||||||
gp_Vec Vapex(aCenter, ElCLib::Value( uLast, anEllipse )) ;
|
gp_Vec Vpnt(aCenter, ElCLib::Value( uFirst, anEllipse )) ;
|
||||||
gp_Vec Vpnt(aCenter, ElCLib::Value( uFirst, anEllipse )) ;
|
gp_Dir dir(Vpnt ^ Vapex);
|
||||||
gp_Dir dir(Vpnt ^ Vapex);
|
Standard_Real parFirst = anEllipse.Position().Direction().IsOpposite( dir, Precision::Angular())? uLast : uFirst;
|
||||||
if(anEllipse.Position().Direction().IsOpposite( dir, Precision::Angular()))
|
const Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
|
||||||
parFirst = uLast;
|
const Standard_Real delta = Alpha / ( NodeNumber - 1 );
|
||||||
else
|
|
||||||
parFirst = uFirst;
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
|
||||||
Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
|
for (Standard_Integer i = 0 ; i < NodeNumber; i++, parFirst += delta)
|
||||||
Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
|
aPrims->AddVertex(ElCLib::Value( parFirst, anEllipse ));
|
||||||
Standard_Real delta = Alpha / ( NodeNumber - 1 );
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
gp_Pnt CurPnt;
|
}
|
||||||
for (Standard_Integer i = 0 ; i < NodeNumber; i++)
|
|
||||||
{
|
|
||||||
CurPnt = ElCLib::Value( parFirst, anEllipse );
|
|
||||||
ApproxArc(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
|
|
||||||
parFirst += delta ;
|
|
||||||
}
|
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc );
|
|
||||||
}
|
|
||||||
DsgPrs_EllipseRadiusPresentation::Add(aPresentation, aDrawer, theval, aText,
|
DsgPrs_EllipseRadiusPresentation::Add(aPresentation, aDrawer, theval, aText,
|
||||||
aPosition, anEndOfArrow, aCenter, IsMaxRadius, ArrowPrs);
|
aPosition, anEndOfArrow, aCenter, IsMaxRadius, ArrowPrs);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Add
|
//function : Add
|
||||||
//purpose : // for offset curve
|
//purpose : // for offset curve
|
||||||
@ -175,41 +150,35 @@ void DsgPrs_EllipseRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aP
|
|||||||
const Standard_Boolean IsMaxRadius,
|
const Standard_Boolean IsMaxRadius,
|
||||||
const DsgPrs_ArrowSide ArrowPrs)
|
const DsgPrs_ArrowSide ArrowPrs)
|
||||||
{
|
{
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
if(!IsInDomain)
|
|
||||||
{
|
|
||||||
Standard_Real parFirst;
|
|
||||||
if(!aCurve->IsCN(1)) return ;
|
|
||||||
gp_Elips aBEllipse = Handle(Geom_Ellipse)::DownCast(aCurve->BasisCurve ())->Elips();
|
|
||||||
Standard_Real Offset = aCurve->Offset();
|
|
||||||
aBEllipse.SetMajorRadius(aBEllipse.MajorRadius() + Offset);
|
|
||||||
aBEllipse.SetMinorRadius(aBEllipse.MinorRadius() + Offset);
|
|
||||||
Standard_Real uLast = ElCLib::Parameter ( aBEllipse, anEndOfArrow );
|
|
||||||
Standard_Real Alpha = DsgPrs::DistanceFromApex(aBEllipse, anEndOfArrow, uFirst);//length of ellipse arc
|
|
||||||
gp_Pnt p1;
|
|
||||||
aCurve->D0(uFirst, p1);
|
|
||||||
gp_Vec Vapex(aCenter, anEndOfArrow) ;
|
|
||||||
gp_Vec Vpnt (aCenter, p1) ;
|
|
||||||
gp_Dir dir(Vpnt ^ Vapex);
|
|
||||||
if(aCurve->Direction().IsOpposite( dir, Precision::Angular()))
|
|
||||||
parFirst = uLast;
|
|
||||||
else
|
|
||||||
parFirst = uFirst;
|
|
||||||
Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
|
|
||||||
Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
|
|
||||||
Standard_Real delta = Alpha / ( NodeNumber - 1 );
|
|
||||||
gp_Pnt CurPnt;
|
|
||||||
for (Standard_Integer i = 0 ; i < NodeNumber; i++)
|
|
||||||
{
|
|
||||||
aCurve->D0( parFirst, CurPnt );
|
|
||||||
ApproxArc(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
|
|
||||||
parFirst += delta ;
|
|
||||||
}
|
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc );
|
|
||||||
}
|
|
||||||
DsgPrs_EllipseRadiusPresentation::Add(aPresentation, aDrawer, theval, aText,
|
|
||||||
aPosition, anEndOfArrow, aCenter, IsMaxRadius, ArrowPrs);
|
|
||||||
|
|
||||||
|
if(!IsInDomain)
|
||||||
|
{
|
||||||
|
if(!aCurve->IsCN(1)) return ;
|
||||||
|
gp_Elips aBEllipse = Handle(Geom_Ellipse)::DownCast(aCurve->BasisCurve ())->Elips();
|
||||||
|
const Standard_Real Offset = aCurve->Offset();
|
||||||
|
aBEllipse.SetMajorRadius(aBEllipse.MajorRadius() + Offset);
|
||||||
|
aBEllipse.SetMinorRadius(aBEllipse.MinorRadius() + Offset);
|
||||||
|
const Standard_Real uLast = ElCLib::Parameter ( aBEllipse, anEndOfArrow );
|
||||||
|
const Standard_Real Alpha = DsgPrs::DistanceFromApex(aBEllipse, anEndOfArrow, uFirst);//length of ellipse arc
|
||||||
|
gp_Pnt p1;
|
||||||
|
aCurve->D0(uFirst, p1);
|
||||||
|
gp_Vec Vapex(aCenter, anEndOfArrow) ;
|
||||||
|
gp_Vec Vpnt (aCenter, p1) ;
|
||||||
|
gp_Dir dir(Vpnt ^ Vapex);
|
||||||
|
Standard_Real parFirst = aCurve->Direction().IsOpposite( dir, Precision::Angular())? uLast : uFirst;
|
||||||
|
const Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
|
||||||
|
const Standard_Real delta = Alpha / ( NodeNumber - 1 );
|
||||||
|
|
||||||
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
|
||||||
|
for (Standard_Integer i = 0 ; i < NodeNumber; i++, parFirst += delta)
|
||||||
|
{
|
||||||
|
aCurve->D0( parFirst, p1 );
|
||||||
|
aPrims->AddVertex(p1);
|
||||||
|
}
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
}
|
||||||
|
DsgPrs_EllipseRadiusPresentation::Add(aPresentation, aDrawer, theval, aText,
|
||||||
|
aPosition, anEndOfArrow, aCenter, IsMaxRadius, ArrowPrs);
|
||||||
}
|
}
|
||||||
|
@ -18,15 +18,14 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_EqualDistancePresentation.ixx>
|
#include <DsgPrs_EqualDistancePresentation.ixx>
|
||||||
|
|
||||||
#include <DsgPrs.hxx>
|
#include <DsgPrs.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Prs3d_LengthAspect.hxx>
|
#include <Prs3d_LengthAspect.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
#include <gp_Dir.hxx>
|
#include <gp_Dir.hxx>
|
||||||
#include <gce_MakeDir.hxx>
|
#include <gce_MakeDir.hxx>
|
||||||
@ -52,24 +51,17 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
|||||||
Handle( Prs3d_LengthAspect ) LA = aDrawer->LengthAspect();
|
Handle( Prs3d_LengthAspect ) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
|
Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex VertexArray( 1, 2 );
|
|
||||||
Quantity_Length X,Y,Z;
|
|
||||||
|
|
||||||
// Line between two middles
|
// Line between two middles
|
||||||
gp_Pnt Middle12( (Point1.XYZ() + Point2.XYZ()) * 0.5 ), Middle34( (Point3.XYZ() + Point4.XYZ()) * 0.5 );
|
gp_Pnt Middle12( (Point1.XYZ() + Point2.XYZ()) * 0.5 ), Middle34( (Point3.XYZ() + Point4.XYZ()) * 0.5 );
|
||||||
|
|
||||||
Middle12.Coord( X, Y, Z );
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
VertexArray( 1 ).SetCoord( X, Y, Z );
|
aPrims->AddVertex(Middle12);
|
||||||
Middle34.Coord( X, Y, Z );
|
aPrims->AddVertex(Middle34);
|
||||||
VertexArray( 2 ).SetCoord( X, Y, Z );
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
|
|
||||||
|
|
||||||
// Add presentation of arrows (points)
|
// Add presentation of arrows (points)
|
||||||
gp_Dir aDir( 0, 0, 1 );
|
gp_Dir aDir( 0, 0, 1 );
|
||||||
DsgPrs::ComputeSymbol(aPresentation, LA,
|
DsgPrs::ComputeSymbol(aPresentation, LA, Middle12, Middle34, aDir, aDir, DsgPrs_AS_BOTHPT );
|
||||||
Middle12, Middle34,
|
|
||||||
aDir, aDir,
|
|
||||||
DsgPrs_AS_BOTHPT );
|
|
||||||
// ota -- begin --
|
// ota -- begin --
|
||||||
// Two small lines in the middle of this line
|
// Two small lines in the middle of this line
|
||||||
gp_Pnt Middle( (Middle12.XYZ() + Middle34.XYZ()) * 0.5 ), aTextPos;
|
gp_Pnt Middle( (Middle12.XYZ() + Middle34.XYZ()) * 0.5 ), aTextPos;
|
||||||
@ -79,22 +71,22 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
|||||||
gp_Vec LineVec, OrtVec;
|
gp_Vec LineVec, OrtVec;
|
||||||
|
|
||||||
if (Dist > Precision::Confusion())
|
if (Dist > Precision::Confusion())
|
||||||
{
|
{
|
||||||
SmallDist = Dist * 0.05; // 1/20.0 part
|
SmallDist = Dist * 0.05; // 1/20.0 part
|
||||||
if (SmallDist <= Precision::Confusion())
|
if (SmallDist <= Precision::Confusion())
|
||||||
SmallDist = Dist;
|
SmallDist = Dist;
|
||||||
LineDir = gce_MakeDir( Middle12, Middle34 );
|
LineDir = gce_MakeDir( Middle12, Middle34 );
|
||||||
OrtDir = Plane->Pln().Axis().Direction() ^ LineDir;
|
OrtDir = Plane->Pln().Axis().Direction() ^ LineDir;
|
||||||
LineVec = gp_Vec( LineDir ) * SmallDist;
|
LineVec = gp_Vec( LineDir ) * SmallDist;
|
||||||
OrtVec = gp_Vec( OrtDir ) * SmallDist;
|
OrtVec = gp_Vec( OrtDir ) * SmallDist;
|
||||||
|
|
||||||
aTextPos = Middle.Translated( OrtVec );
|
aTextPos = Middle.Translated( OrtVec );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gp_Vec Vec1( Middle, Point1 );
|
gp_Vec Vec1( Middle, Point1 );
|
||||||
|
|
||||||
if (Vec1.SquareMagnitude() > Precision::SquareConfusion())
|
if (Vec1.SquareMagnitude() > Precision::Confusion()*Precision::Confusion())
|
||||||
{
|
{
|
||||||
Standard_Real Angle = gp_Vec( Middle, Point1 ).Angle( gp_Vec( Middle, Point3 ) );
|
Standard_Real Angle = gp_Vec( Middle, Point1 ).Angle( gp_Vec( Middle, Point3 ) );
|
||||||
gp_Pnt MidPnt = Point1.Rotated( Plane->Pln().Axis(), Angle*0.5 );
|
gp_Pnt MidPnt = Point1.Rotated( Plane->Pln().Axis(), Angle*0.5 );
|
||||||
@ -109,14 +101,14 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
|||||||
OrtVec = gp_Vec( OrtDir ) * SmallDist;
|
OrtVec = gp_Vec( OrtDir ) * SmallDist;
|
||||||
LineVec = gp_Vec( LineDir ) * SmallDist;
|
LineVec = gp_Vec( LineDir ) * SmallDist;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SmallDist = 5.0;
|
SmallDist = 5.0;
|
||||||
OrtVec = gp_Vec( Plane->Pln().XAxis().Direction() ) * SmallDist;
|
OrtVec = gp_Vec( Plane->Pln().XAxis().Direction() ) * SmallDist;
|
||||||
LineVec = gp_Vec( Plane->Pln().YAxis().Direction() ) * SmallDist;
|
LineVec = gp_Vec( Plane->Pln().YAxis().Direction() ) * SmallDist;
|
||||||
}
|
}
|
||||||
aTextPos = Middle.Translated (OrtVec);
|
aTextPos = Middle.Translated (OrtVec);
|
||||||
}
|
}
|
||||||
|
|
||||||
TCollection_ExtendedString aText("==");
|
TCollection_ExtendedString aText("==");
|
||||||
|
|
||||||
@ -124,6 +116,7 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
|||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(), aText, aTextPos);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(), aText, aTextPos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//==================================================================================
|
//==================================================================================
|
||||||
//function : AddInterval
|
//function : AddInterval
|
||||||
//purpose : is used for presentation of interval between two lines or two points,
|
//purpose : is used for presentation of interval between two lines or two points,
|
||||||
@ -140,7 +133,6 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
|||||||
gp_Pnt& aProj2)
|
gp_Pnt& aProj2)
|
||||||
{
|
{
|
||||||
const Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
const Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
//set color
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
gp_Lin L1 (aPoint1,aDirection);
|
gp_Lin L1 (aPoint1,aDirection);
|
||||||
@ -148,39 +140,20 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
|||||||
aProj1 = ElCLib::Value(ElCLib::Parameter(L1, aPosition),L1);
|
aProj1 = ElCLib::Value(ElCLib::Parameter(L1, aPosition),L1);
|
||||||
aProj2 = ElCLib::Value(ElCLib::Parameter(L2, aPosition),L2);
|
aProj2 = ElCLib::Value(ElCLib::Parameter(L2, aPosition),L2);
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(4);
|
||||||
|
aPrims->AddVertex(aPoint1);
|
||||||
Quantity_Length X,Y,Z;
|
aPrims->AddVertex(aProj1);
|
||||||
|
aPrims->AddVertex(aProj2);
|
||||||
aProj1.Coord (X, Y, Z);
|
aPrims->AddVertex(aPoint2);
|
||||||
V(1).SetCoord(X, Y, Z);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
aPoint1.Coord(X, Y, Z);
|
|
||||||
V(2).SetCoord(X, Y, Z);
|
|
||||||
|
|
||||||
//add first attached line
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
//add distance interval
|
|
||||||
aProj2.Coord(X, Y, Z);
|
|
||||||
V(2).SetCoord(X, Y, Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
|
|
||||||
//add second attached line
|
|
||||||
aPoint2.Coord(X, Y, Z);
|
|
||||||
V(1).SetCoord(X, Y, Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
//add arrows presentation
|
//add arrows presentation
|
||||||
gp_Dir aDir(aProj2.XYZ() - aProj1.XYZ());
|
gp_Dir aDir(aProj2.XYZ() - aProj1.XYZ());
|
||||||
|
|
||||||
DsgPrs::ComputeSymbol(aPresentation, LA,
|
DsgPrs::ComputeSymbol(aPresentation, LA, aProj1, aProj2, aDir.Reversed(), aDir, anArrowSide);
|
||||||
aProj1, aProj2,
|
|
||||||
aDir.Reversed(), aDir,
|
|
||||||
anArrowSide);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
// function : AddIntervalBetweenTwoArcs
|
// function : AddIntervalBetweenTwoArcs
|
||||||
// purpose : is used for presentation of interval between two arcs. One
|
// purpose : is used for presentation of interval between two arcs. One
|
||||||
@ -197,9 +170,9 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
|||||||
const gp_Pnt& aPoint4,
|
const gp_Pnt& aPoint4,
|
||||||
const DsgPrs_ArrowSide anArrowSide)
|
const DsgPrs_ArrowSide anArrowSide)
|
||||||
{
|
{
|
||||||
//it seems to set color
|
|
||||||
const Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
const Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
Standard_Real aPar11, aPar12, aPar21, aPar22;
|
Standard_Real aPar11, aPar12, aPar21, aPar22;
|
||||||
if(aCirc1.Radius() > Precision::Confusion()){
|
if(aCirc1.Radius() > Precision::Confusion()){
|
||||||
aPar11 = ElCLib::Parameter (aCirc1, aPoint1);
|
aPar11 = ElCLib::Parameter (aCirc1, aPoint1);
|
||||||
@ -218,49 +191,48 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
|||||||
aPar22 = M_PI;
|
aPar22 = M_PI;
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
V(1).SetCoord(aPoint2.X(), aPoint2.Y(), aPoint2.Z());
|
aPrims->AddVertex(aPoint2);
|
||||||
V(2).SetCoord(aPoint4.X(), aPoint4.Y(), aPoint4.Z());
|
aPrims->AddVertex(aPoint4);
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( V );
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
Standard_Integer aNodeNb;
|
Standard_Integer i, aNodeNb;
|
||||||
Standard_Real aDelta, aCurPar;
|
Standard_Real aDelta, aCurPar;
|
||||||
if(aPar12 < aPar11 ) aPar12 +=2*M_PI;
|
if(aPar12 < aPar11 ) aPar12 += 2.*M_PI;
|
||||||
if (Abs(aPar12 - aPar11) > Precision::Confusion()) {
|
if (Abs(aPar12 - aPar11) > Precision::Confusion())
|
||||||
|
{
|
||||||
aNodeNb = Standard_Integer(Max(Abs(aPar12 - aPar11)*50./M_PI + 0.5, 4.));
|
aNodeNb = Standard_Integer(Max(Abs(aPar12 - aPar11)*50./M_PI + 0.5, 4.));
|
||||||
Graphic3d_Array1OfVertex ApproxArc1( 1, aNodeNb+1);
|
|
||||||
aDelta = (aPar12 - aPar11)/aNodeNb;
|
aDelta = (aPar12 - aPar11)/aNodeNb;
|
||||||
aCurPar= aPar11;
|
aCurPar= aPar11;
|
||||||
for ( int i = 1; i<= aNodeNb ; aCurPar+= aDelta, i++)
|
|
||||||
{
|
|
||||||
gp_Pnt CurPnt = ElCLib::Value( aCurPar, aCirc1);
|
|
||||||
ApproxArc1(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
|
|
||||||
}
|
|
||||||
ApproxArc1(aNodeNb+1).SetCoord( aPoint2.X(), aPoint2.Y(), aPoint2.Z() );
|
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc1 );
|
aPrims = new Graphic3d_ArrayOfPolylines(aNodeNb+1);
|
||||||
|
for (i = 1; i<= aNodeNb; aCurPar += aDelta, i++)
|
||||||
|
aPrims->AddVertex(ElCLib::Value( aCurPar, aCirc1));
|
||||||
|
aPrims->AddVertex(aPoint2);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
if (aPar22 < aPar21) aPar22 += 2*M_PI;
|
if (aPar22 < aPar21) aPar22 += 2.*M_PI;
|
||||||
if ( Abs(aPar22 - aPar21) > Precision::Confusion()){
|
if ( Abs(aPar22 - aPar21) > Precision::Confusion())
|
||||||
|
{
|
||||||
aNodeNb = Standard_Integer(Max(Abs(aPar22 - aPar21)*50./M_PI + 0.5, 4.));
|
aNodeNb = Standard_Integer(Max(Abs(aPar22 - aPar21)*50./M_PI + 0.5, 4.));
|
||||||
Graphic3d_Array1OfVertex ApproxArc2( 1, aNodeNb+1);
|
|
||||||
aDelta = (aPar22 - aPar21)/aNodeNb;
|
aDelta = (aPar22 - aPar21)/aNodeNb;
|
||||||
aCurPar= aPar21;
|
aCurPar= aPar21;
|
||||||
for ( int i=1; i<= aNodeNb; aCurPar+= aDelta, i++)
|
|
||||||
{
|
aPrims = new Graphic3d_ArrayOfPolylines(aNodeNb+1);
|
||||||
gp_Pnt CurPnt = ElCLib::Value( aCurPar, aCirc2);
|
for (i = 1; i<= aNodeNb; aCurPar += aDelta, i++)
|
||||||
ApproxArc2(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
|
aPrims->AddVertex(ElCLib::Value( aCurPar, aCirc2));
|
||||||
}
|
aPrims->AddVertex(aPoint4);
|
||||||
ApproxArc2(aNodeNb+1).SetCoord( aPoint4.X(), aPoint4.Y(), aPoint4.Z() );
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc2 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//get the direction of interval
|
//get the direction of interval
|
||||||
gp_Dir DirOfArrow;
|
gp_Dir DirOfArrow;
|
||||||
if(aPoint4.Distance(aPoint2) > Precision::Confusion()){
|
if(aPoint4.Distance(aPoint2) > Precision::Confusion())
|
||||||
|
{
|
||||||
DirOfArrow.SetXYZ(aPoint4.XYZ() - aPoint2.XYZ());
|
DirOfArrow.SetXYZ(aPoint4.XYZ() - aPoint2.XYZ());
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
//Let's take the radius direction
|
//Let's take the radius direction
|
||||||
gp_Pnt aCenter = aCirc1.Location();
|
gp_Pnt aCenter = aCirc1.Location();
|
||||||
if(aPoint4.Distance(aCenter) < Precision::Confusion())
|
if(aPoint4.Distance(aCenter) < Precision::Confusion())
|
||||||
@ -270,6 +242,5 @@ void DsgPrs_EqualDistancePresentation::Add( const Handle( Prs3d_Presentation )&
|
|||||||
|
|
||||||
// Add presentation of arrows
|
// Add presentation of arrows
|
||||||
DsgPrs::ComputeSymbol( aPresentation, LA, aPoint2, aPoint4, DirOfArrow.Reversed(), DirOfArrow, anArrowSide );
|
DsgPrs::ComputeSymbol( aPresentation, LA, aPoint2, aPoint4, DirOfArrow.Reversed(), DirOfArrow, anArrowSide );
|
||||||
|
|
||||||
}
|
}
|
||||||
//-- ota -- end
|
//-- ota -- end
|
||||||
|
@ -18,15 +18,13 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_EqualRadiusPresentation.ixx>
|
#include <DsgPrs_EqualRadiusPresentation.ixx>
|
||||||
|
|
||||||
#include <DsgPrs.hxx>
|
#include <DsgPrs.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Prs3d_LengthAspect.hxx>
|
#include <Prs3d_LengthAspect.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
#include <gp_Dir.hxx>
|
#include <gp_Dir.hxx>
|
||||||
#include <gce_MakeDir.hxx>
|
#include <gce_MakeDir.hxx>
|
||||||
@ -47,40 +45,19 @@ void DsgPrs_EqualRadiusPresentation::Add( const Handle( Prs3d_Presentation )& aP
|
|||||||
Handle( Prs3d_LengthAspect ) LA = aDrawer->LengthAspect();
|
Handle( Prs3d_LengthAspect ) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
|
Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex VertexArray( 1, 2 );
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(4);
|
||||||
Quantity_Length X,Y,Z;
|
aPrims->AddVertex(FirstPoint);
|
||||||
|
aPrims->AddVertex(FirstCenter);
|
||||||
// Radius lines
|
aPrims->AddVertex(SecondCenter);
|
||||||
FirstCenter.Coord( X, Y, Z );
|
aPrims->AddVertex(SecondPoint);
|
||||||
VertexArray( 1 ).SetCoord( X, Y, Z );
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
FirstPoint.Coord( X, Y, Z );
|
|
||||||
VertexArray( 2 ).SetCoord( X, Y, Z );
|
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
|
|
||||||
|
|
||||||
SecondCenter.Coord( X, Y, Z );
|
|
||||||
VertexArray( 1 ).SetCoord( X, Y, Z );
|
|
||||||
SecondPoint.Coord( X, Y, Z );
|
|
||||||
VertexArray( 2 ).SetCoord( X, Y, Z );
|
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
|
|
||||||
|
|
||||||
// Add presentation of arrows
|
// Add presentation of arrows
|
||||||
gp_Dir FirstDir = gce_MakeDir( FirstCenter, FirstPoint ), SecondDir = gce_MakeDir( SecondCenter, SecondPoint );
|
gp_Dir FirstDir = gce_MakeDir( FirstCenter, FirstPoint ), SecondDir = gce_MakeDir( SecondCenter, SecondPoint );
|
||||||
DsgPrs::ComputeSymbol( aPresentation, LA,
|
DsgPrs::ComputeSymbol( aPresentation, LA, FirstCenter, FirstPoint, FirstDir.Reversed(), FirstDir, DsgPrs_AS_FIRSTPT_LASTAR );
|
||||||
FirstCenter, FirstPoint,
|
DsgPrs::ComputeSymbol( aPresentation, LA, SecondCenter, SecondPoint, SecondDir.Reversed(), SecondDir, DsgPrs_AS_FIRSTPT_LASTAR );
|
||||||
FirstDir.Reversed(), FirstDir,
|
|
||||||
DsgPrs_AS_FIRSTPT_LASTAR );
|
|
||||||
DsgPrs::ComputeSymbol( aPresentation, LA,
|
|
||||||
SecondCenter, SecondPoint,
|
|
||||||
SecondDir.Reversed(), SecondDir,
|
|
||||||
DsgPrs_AS_FIRSTPT_LASTAR );
|
|
||||||
|
|
||||||
// Line between two centers
|
|
||||||
FirstCenter.Coord( X, Y, Z );
|
|
||||||
VertexArray( 2 ).SetCoord( X, Y, Z );
|
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
|
|
||||||
|
|
||||||
//ota === beging ===
|
//ota === beging ===
|
||||||
|
|
||||||
gp_Pnt Middle( (FirstCenter.XYZ() + SecondCenter.XYZ()) *0.5 ), aTextPos;
|
gp_Pnt Middle( (FirstCenter.XYZ() + SecondCenter.XYZ()) *0.5 ), aTextPos;
|
||||||
Standard_Real SmallDist;
|
Standard_Real SmallDist;
|
||||||
//Mark of constraint
|
//Mark of constraint
|
||||||
@ -88,34 +65,33 @@ void DsgPrs_EqualRadiusPresentation::Add( const Handle( Prs3d_Presentation )& aP
|
|||||||
|
|
||||||
Standard_Real Dist = FirstCenter.Distance( SecondCenter );
|
Standard_Real Dist = FirstCenter.Distance( SecondCenter );
|
||||||
if (Dist > Precision::Confusion())
|
if (Dist > Precision::Confusion())
|
||||||
{
|
{
|
||||||
SmallDist = Dist * 0.05; // take 1/20 part of length;
|
SmallDist = Dist * 0.05; // take 1/20 part of length;
|
||||||
if (SmallDist <= Precision::Confusion())
|
if (SmallDist <= Precision::Confusion())
|
||||||
SmallDist = Dist;
|
SmallDist = Dist;
|
||||||
gp_Dir LineDir = gce_MakeDir( FirstCenter, SecondCenter );
|
gp_Dir LineDir = gce_MakeDir( FirstCenter, SecondCenter );
|
||||||
gp_Dir OrtDir = Plane->Pln().Axis().Direction() ^ LineDir;
|
gp_Dir OrtDir = Plane->Pln().Axis().Direction() ^ LineDir;
|
||||||
|
|
||||||
gp_Vec OrtVec = gp_Vec( OrtDir ) * SmallDist;
|
gp_Vec OrtVec = gp_Vec( OrtDir ) * SmallDist;
|
||||||
|
|
||||||
//Compute the text position
|
//Compute the text position
|
||||||
aTextPos = Middle.Translated(OrtVec);
|
aTextPos = Middle.Translated(OrtVec);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Standard_Real Rad = Max(FirstCenter.Distance( FirstPoint ),
|
Standard_Real Rad = Max(FirstCenter.Distance( FirstPoint ), SecondCenter.Distance(SecondPoint));
|
||||||
SecondCenter.Distance(SecondPoint));
|
|
||||||
|
|
||||||
SmallDist = Rad *0.05; // take 1/20 part of length;
|
SmallDist = Rad *0.05; // take 1/20 part of length;
|
||||||
if (SmallDist <= Precision::Confusion())
|
if (SmallDist <= Precision::Confusion())
|
||||||
SmallDist = Rad;
|
SmallDist = Rad;
|
||||||
|
|
||||||
gp_Vec aVec(SmallDist, SmallDist, SmallDist);
|
gp_Vec aVec(SmallDist, SmallDist, SmallDist);
|
||||||
|
|
||||||
//Compute the text position
|
//Compute the text position
|
||||||
aTextPos = FirstCenter.Translated(aVec);
|
aTextPos = FirstCenter.Translated(aVec);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Draw the text
|
//Draw the text
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText, aTextPos);
|
Prs3d_Text::Draw(aPresentation, LA->TextAspect(),aText, aTextPos);
|
||||||
//ota === end ===
|
//ota === end ===
|
||||||
}
|
}
|
||||||
|
@ -18,15 +18,14 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_FilletRadiusPresentation.ixx>
|
#include <DsgPrs_FilletRadiusPresentation.ixx>
|
||||||
|
|
||||||
#include <gp_Lin.hxx>
|
#include <gp_Lin.hxx>
|
||||||
#include <gp_Dir.hxx>
|
#include <gp_Dir.hxx>
|
||||||
#include <ElCLib.hxx>
|
#include <ElCLib.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Prs3d_LengthAspect.hxx>
|
#include <Prs3d_LengthAspect.hxx>
|
||||||
#include <Prs3d_Arrow.hxx>
|
#include <Prs3d_Arrow.hxx>
|
||||||
#include <Prs3d_ArrowAspect.hxx>
|
#include <Prs3d_ArrowAspect.hxx>
|
||||||
@ -79,6 +78,7 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr
|
|||||||
{
|
{
|
||||||
char valcar[80];
|
char valcar[80];
|
||||||
sprintf(valcar,"%5.2f",theval);
|
sprintf(valcar,"%5.2f",theval);
|
||||||
|
|
||||||
Standard_Real FirstParCirc, LastParCirc;
|
Standard_Real FirstParCirc, LastParCirc;
|
||||||
Standard_Boolean SpecCase;
|
Standard_Boolean SpecCase;
|
||||||
gp_Dir DirOfArrow;
|
gp_Dir DirOfArrow;
|
||||||
@ -86,6 +86,7 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr
|
|||||||
// gp_Pnt NewPosition, EndOfArrow;
|
// gp_Pnt NewPosition, EndOfArrow;
|
||||||
Handle( Prs3d_LengthAspect ) LA = aDrawer->LengthAspect();
|
Handle( Prs3d_LengthAspect ) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
|
Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
|
||||||
|
|
||||||
Standard_Real ArrowLength = LA->Arrow1Aspect()->Length();
|
Standard_Real ArrowLength = LA->Arrow1Aspect()->Length();
|
||||||
DsgPrs::ComputeFilletRadiusPresentation( ArrowLength,
|
DsgPrs::ComputeFilletRadiusPresentation( ArrowLength,
|
||||||
theval,
|
theval,
|
||||||
@ -106,40 +107,34 @@ void DsgPrs_FilletRadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPr
|
|||||||
);
|
);
|
||||||
// Creating the fillet's arc
|
// Creating the fillet's arc
|
||||||
if( !SpecCase )
|
if( !SpecCase )
|
||||||
{
|
{
|
||||||
Standard_Real Alpha = Abs(LastParCirc - FirstParCirc);
|
const Standard_Real Alpha = Abs(LastParCirc - FirstParCirc);
|
||||||
Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
|
const Standard_Integer NodeNumber = Max (4 , Standard_Integer (50. * Alpha / M_PI));
|
||||||
Graphic3d_Array1OfVertex ApproxArc( 0, NodeNumber-1 );
|
const Standard_Real delta = Alpha / ( NodeNumber - 1 );
|
||||||
Standard_Real delta = Alpha / ( NodeNumber - 1 );
|
|
||||||
gp_Pnt CurPnt;
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
|
||||||
for (Standard_Integer i = 0 ; i < NodeNumber; i++)
|
for (Standard_Integer i = 0 ; i < NodeNumber; i++, FirstParCirc += delta)
|
||||||
{
|
aPrims->AddVertex(ElCLib::Value( FirstParCirc, FilletCirc ));
|
||||||
CurPnt = ElCLib::Value( FirstParCirc, FilletCirc );
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
ApproxArc(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
|
|
||||||
FirstParCirc += delta ;
|
HasCircle = Standard_True;
|
||||||
}
|
Handle(Geom_Circle) Circle = new Geom_Circle( FilletCirc );
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxArc );
|
TrimCurve = new Geom_TrimmedCurve( Circle, FirstParCirc, LastParCirc );
|
||||||
HasCircle = Standard_True;
|
}
|
||||||
Handle(Geom_Circle) Circle = new Geom_Circle( FilletCirc );
|
|
||||||
TrimCurve = new Geom_TrimmedCurve( Circle, FirstParCirc, LastParCirc );
|
|
||||||
}
|
|
||||||
else // null or PI anle or Radius = 0
|
else // null or PI anle or Radius = 0
|
||||||
{
|
{
|
||||||
HasCircle = Standard_False;
|
HasCircle = Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Line from position to intersection point on fillet's circle (EndOfArrow)
|
// Line from position to intersection point on fillet's circle (EndOfArrow)
|
||||||
Graphic3d_Array1OfVertex Vrap(1,2);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
Vrap(1).SetCoord(DrawPosition.X(),
|
aPrims->AddVertex(DrawPosition);
|
||||||
DrawPosition.Y(),
|
aPrims->AddVertex(EndOfArrow);
|
||||||
DrawPosition.Z());
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
Vrap(2).SetCoord( EndOfArrow.X(), EndOfArrow.Y(), EndOfArrow.Z() );
|
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( Vrap );
|
|
||||||
// Drawing the text
|
// Drawing the text
|
||||||
Prs3d_Text::Draw(aPresentation, LA->TextAspect(), aText, DrawPosition);
|
Prs3d_Text::Draw(aPresentation, LA->TextAspect(), aText, DrawPosition);
|
||||||
|
|
||||||
// Add presentation of arrows
|
// Add presentation of arrows
|
||||||
DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow, EndOfArrow, DirOfArrow, DirOfArrow, ArrowPrs );
|
DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow, EndOfArrow, DirOfArrow, DirOfArrow, ArrowPrs );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,11 +18,9 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_FixPresentation.ixx>
|
#include <DsgPrs_FixPresentation.ixx>
|
||||||
|
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_AspectMarker3d.hxx>
|
#include <Graphic3d_AspectMarker3d.hxx>
|
||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
@ -44,8 +42,6 @@
|
|||||||
#include <Quantity_Color.hxx>
|
#include <Quantity_Color.hxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Add
|
//function : Add
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -62,57 +58,52 @@ void DsgPrs_FixPresentation::Add(
|
|||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(10);
|
||||||
|
|
||||||
//Trace du segment de raccordement
|
//Trace du segment de raccordement
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
aPrims->AddVertex(aPntAttach);
|
||||||
V(1).SetCoord(aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
|
aPrims->AddVertex(aPntEnd);
|
||||||
V(2).SetCoord(aPntEnd.X(), aPntEnd.Y(), aPntEnd.Z() );
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// trace du symbole 'Fix'
|
// trace du symbole 'Fix'
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
gp_Vec dirac(aPntAttach, aPntEnd); // vecteur directeur du seg. de raccord
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
|
|
||||||
|
|
||||||
gp_Vec dirac(aPntAttach, aPntEnd);
|
|
||||||
// vecteur directeur du seg. de raccord
|
|
||||||
dirac.Normalize();
|
dirac.Normalize();
|
||||||
gp_Vec norac = dirac.Crossed(gp_Vec(aNormPln));
|
gp_Vec norac = dirac.Crossed(gp_Vec(aNormPln));
|
||||||
gp_Ax1 ax(aPntEnd, aNormPln);
|
gp_Ax1 ax(aPntEnd, aNormPln);
|
||||||
norac.Rotate(ax, M_PI/8);
|
norac.Rotate(ax, M_PI/8); // vecteur normal au seg. de raccord
|
||||||
// vecteur normal au seg. de raccord
|
|
||||||
norac*=(symbsize/2);
|
norac*=(symbsize/2);
|
||||||
gp_Pnt P1 = aPntEnd.Translated(norac);
|
gp_Pnt P1 = aPntEnd.Translated(norac);
|
||||||
gp_Pnt P2 = aPntEnd.Translated(-norac);
|
gp_Pnt P2 = aPntEnd.Translated(-norac);
|
||||||
|
|
||||||
V(1).SetCoord(P1.X(),P1.Y(),P1.Z());
|
aPrims->AddVertex(P1);
|
||||||
V(2).SetCoord(P2.X(),P2.Y(),P2.Z());
|
aPrims->AddVertex(P2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// trace des 'dents'
|
// trace des 'dents'
|
||||||
norac*=0.8;
|
norac*=0.8;
|
||||||
P1 = aPntEnd.Translated(norac);
|
P1 = aPntEnd.Translated(norac);
|
||||||
P2 = aPntEnd.Translated(-norac);
|
P2 = aPntEnd.Translated(-norac);
|
||||||
dirac*=(symbsize/2);
|
dirac*=(symbsize/2);
|
||||||
gp_Pnt PF(P1.XYZ());
|
gp_Pnt PF = P1;
|
||||||
gp_Pnt PL = PF.Translated(dirac);
|
gp_Pnt PL = PF.Translated(dirac);
|
||||||
PL.Translate(norac);
|
PL.Translate(norac);
|
||||||
V(1).SetCoord( PF.X(), PF.Y(), PF.Z() );
|
|
||||||
V(2).SetCoord( PL.X(), PL.Y(), PL.Z() );
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
PF.SetXYZ(P2.XYZ());
|
aPrims->AddVertex(PF);
|
||||||
|
aPrims->AddVertex(PL);
|
||||||
|
|
||||||
|
PF = P2;
|
||||||
PL = PF.Translated(dirac);
|
PL = PF.Translated(dirac);
|
||||||
PL.Translate(norac);
|
PL.Translate(norac);
|
||||||
V(1).SetCoord( PF.X(), PF.Y(), PF.Z() );
|
|
||||||
V(2).SetCoord( PL.X(), PL.Y(), PL.Z() );
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
PF.SetXYZ((P1.XYZ() + P2.XYZ())/2);
|
aPrims->AddVertex(PF);
|
||||||
|
aPrims->AddVertex(PL);
|
||||||
|
|
||||||
|
PF.SetXYZ(0.5*(P1.XYZ() + P2.XYZ()));
|
||||||
PL = PF.Translated(dirac);
|
PL = PF.Translated(dirac);
|
||||||
PL.Translate(norac);
|
PL.Translate(norac);
|
||||||
V(1).SetCoord( PF.X(), PF.Y(), PF.Z() );
|
|
||||||
V(2).SetCoord( PL.X(), PL.Y(), PL.Z() );
|
aPrims->AddVertex(PF);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(PL);
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// On ajoute un rond au point d'attache
|
// On ajoute un rond au point d'attache
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
@ -128,5 +119,4 @@ void DsgPrs_FixPresentation::Add(
|
|||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
|
||||||
Graphic3d_Vertex V3d(aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
|
Graphic3d_Vertex V3d(aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
|
Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,8 @@
|
|||||||
#include <DsgPrs_IdenticPresentation.ixx>
|
#include <DsgPrs_IdenticPresentation.ixx>
|
||||||
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Graphic3d_AspectMarker3d.hxx>
|
#include <Graphic3d_AspectMarker3d.hxx>
|
||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
|
|
||||||
@ -50,12 +51,10 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent
|
|||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
V(1).SetCoord(aPntAttach.X(), aPntAttach.Y(), aPntAttach.Z());
|
aPrims->AddVertex(aPntAttach);
|
||||||
V(2).SetCoord(aPntOffset.X(), aPntOffset.Y(), aPntOffset.Z());
|
aPrims->AddVertex(aPntOffset);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
// trait de cote
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// On ajoute un rond au point d'attache
|
// On ajoute un rond au point d'attache
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
@ -77,7 +76,6 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresentation,
|
void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresentation,
|
||||||
const Handle(Prs3d_Drawer)& aDrawer,
|
const Handle(Prs3d_Drawer)& aDrawer,
|
||||||
const TCollection_ExtendedString& aText,
|
const TCollection_ExtendedString& aText,
|
||||||
@ -88,33 +86,32 @@ void DsgPrs_IdenticPresentation::Add( const Handle(Prs3d_Presentation)& aPresent
|
|||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(4);
|
||||||
V(1).SetCoord(aFAttach.X(), aFAttach.Y(), aFAttach.Z());
|
|
||||||
V(2).SetCoord(aSAttach.X(), aSAttach.Y(), aSAttach.Z());
|
|
||||||
|
|
||||||
// trait de cote
|
aPrims->AddVertex(aFAttach);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(aSAttach);
|
||||||
|
|
||||||
// trait joignant aPntOffset
|
// trait joignant aPntOffset
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
gp_Vec v1(aFAttach, aSAttach);
|
gp_Vec v1(aFAttach, aSAttach);
|
||||||
gp_Vec v2(aSAttach, aPntOffset);
|
gp_Vec v2(aSAttach, aPntOffset);
|
||||||
V(1).SetCoord(aPntOffset.X(), aPntOffset.Y(), aPntOffset.Z());
|
|
||||||
if ( !v1.IsParallel(v2, Precision::Angular())) {
|
aPrims->AddVertex(aPntOffset);
|
||||||
|
if ( !v1.IsParallel(v2, Precision::Angular()))
|
||||||
|
{
|
||||||
// on joint aPntOffset a son projete
|
// on joint aPntOffset a son projete
|
||||||
gp_Lin ll(aFAttach, gp_Dir(v1));
|
gp_Lin ll(aFAttach, gp_Dir(v1));
|
||||||
gp_Pnt ProjPntOffset = ElCLib::Value(ElCLib::Parameter(ll,aPntOffset ), ll);
|
aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(ll,aPntOffset ), ll));
|
||||||
V(2).SetCoord(ProjPntOffset.X(), ProjPntOffset.Y(), ProjPntOffset.Z());
|
|
||||||
}
|
}
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
else
|
||||||
|
aPrims->AddVertex(aSAttach);
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// texte
|
// texte
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresentation,
|
void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresentation,
|
||||||
const Handle(Prs3d_Drawer)& aDrawer,
|
const Handle(Prs3d_Drawer)& aDrawer,
|
||||||
const TCollection_ExtendedString& aText,
|
const TCollection_ExtendedString& aText,
|
||||||
@ -134,32 +131,29 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
Standard_Real pFAttach = ElCLib::Parameter(CC, aFAttach);
|
Standard_Real pFAttach = ElCLib::Parameter(CC, aFAttach);
|
||||||
Standard_Real pSAttach = ElCLib::Parameter(CC, aSAttach);
|
Standard_Real pSAttach = ElCLib::Parameter(CC, aSAttach);
|
||||||
Standard_Real alpha = pSAttach - pFAttach;
|
Standard_Real alpha = pSAttach - pFAttach;
|
||||||
if ( alpha < 0 ) alpha += 2 * M_PI;
|
if ( alpha < 0 ) alpha += 2. * M_PI;
|
||||||
Standard_Integer nb = (Standard_Integer )( 50. * alpha / M_PI);
|
const Standard_Integer nb = (Standard_Integer )( 50. * alpha / M_PI);
|
||||||
Standard_Integer nbp = Max (4 , nb);
|
const Standard_Integer nbp = Max (4, nb);
|
||||||
Graphic3d_Array1OfVertex V(1,nbp);
|
const Standard_Real dteta = alpha/(nbp-1);
|
||||||
Standard_Real dteta = alpha/(nbp-1);
|
|
||||||
gp_Pnt ptcur;
|
|
||||||
for (Standard_Integer i = 1; i<=nbp; i++)
|
|
||||||
{
|
|
||||||
ptcur = ElCLib::Value(pFAttach + dteta*(i-1),CC);
|
|
||||||
V(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
|
|
||||||
}
|
|
||||||
|
|
||||||
// trait de cote
|
Handle(Graphic3d_ArrayOfPolylines) aPrims;
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// trait joignant aPntOffset
|
// trait joignant aPntOffset
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
if ( Abs((aPntOffset.Distance(aCenter) - rad )) >= Precision::Confusion() )
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
{
|
||||||
Graphic3d_Array1OfVertex V2(1,2);
|
aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
|
||||||
if ( Abs((aPntOffset.Distance(aCenter) - rad )) >= Precision::Confusion() ) {
|
aPrims->AddBound(2);
|
||||||
gp_Pnt ProjPntOffset = ElCLib::Value(ElCLib::Parameter(CC,aPntOffset ), CC);
|
aPrims->AddVertex(aPntOffset);
|
||||||
|
aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(CC,aPntOffset ), CC));
|
||||||
V2(1).SetCoord(aPntOffset.X(), aPntOffset.Y(), aPntOffset.Z());
|
aPrims->AddBound(nbp);
|
||||||
V2(2).SetCoord(ProjPntOffset.X(), ProjPntOffset.Y(), ProjPntOffset.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V2);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
aPrims = new Graphic3d_ArrayOfPolylines(nbp);
|
||||||
|
|
||||||
|
for (Standard_Integer i = 1; i<=nbp; i++)
|
||||||
|
aPrims->AddVertex(ElCLib::Value(pFAttach + dteta*(i-1),CC));
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// texte
|
// texte
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
|
||||||
@ -183,34 +177,32 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
ax.SetLocation(aCenter);
|
ax.SetLocation(aCenter);
|
||||||
Standard_Real rad = aCenter.Distance(aFAttach);
|
Standard_Real rad = aCenter.Distance(aFAttach);
|
||||||
gp_Circ CC(ax,rad );
|
gp_Circ CC(ax,rad );
|
||||||
Standard_Real pFAttach = ElCLib::Parameter(CC, aFAttach);
|
Standard_Real pFAttach = ElCLib::Parameter(CC, aFAttach);
|
||||||
Standard_Real pSAttach = ElCLib::Parameter(CC, aSAttach);
|
Standard_Real pSAttach = ElCLib::Parameter(CC, aSAttach);
|
||||||
Standard_Real alpha = pSAttach - pFAttach;
|
Standard_Real alpha = pSAttach - pFAttach;
|
||||||
if ( alpha < 0 ) alpha += 2 * M_PI;
|
if ( alpha < 0 ) alpha += 2. * M_PI;
|
||||||
Standard_Integer nb = (Standard_Integer )( 50. * alpha / M_PI);
|
const Standard_Integer nb = (Standard_Integer)( 50. * alpha / M_PI);
|
||||||
Standard_Integer nbp = Max (4 , nb);
|
const Standard_Integer nbp = Max (4, nb);
|
||||||
Graphic3d_Array1OfVertex V(1,nbp);
|
const Standard_Real dteta = alpha/(nbp-1);
|
||||||
Standard_Real dteta = alpha/(nbp-1);
|
|
||||||
gp_Pnt ptcur;
|
|
||||||
for (Standard_Integer i = 1; i<=nbp; i++)
|
|
||||||
{
|
|
||||||
ptcur = ElCLib::Value(pFAttach + dteta*(i-1),CC);
|
|
||||||
V(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
|
|
||||||
}
|
|
||||||
|
|
||||||
// trait de cote
|
Handle(Graphic3d_ArrayOfPolylines) aPrims;
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// trait joignant aPntOffset
|
// trait joignant aPntOffset
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Graphic3d_Array1OfVertex V2(1,2);
|
|
||||||
if ( aPntOffset.Distance(aPntOnCirc) >= Precision::Confusion() )
|
if ( aPntOffset.Distance(aPntOnCirc) >= Precision::Confusion() )
|
||||||
{
|
{
|
||||||
V2(1).SetCoord(aPntOffset.X(), aPntOffset.Y(), aPntOffset.Z());
|
aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
|
||||||
V2(2).SetCoord(aPntOnCirc.X(), aPntOnCirc.Y(), aPntOnCirc.Z());
|
aPrims->AddBound(2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V2);
|
aPrims->AddVertex(aPntOffset);
|
||||||
}
|
aPrims->AddVertex(aPntOnCirc);
|
||||||
|
aPrims->AddBound(nbp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aPrims = new Graphic3d_ArrayOfPolylines(nbp);
|
||||||
|
|
||||||
|
for (Standard_Integer i = 1; i<=nbp; i++)
|
||||||
|
aPrims->AddVertex(ElCLib::Value(pFAttach + dteta*(i-1),CC));
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// texte
|
// texte
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
|
||||||
@ -233,32 +225,29 @@ void DsgPrs_IdenticPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
Standard_Real pFAttach = ElCLib::Parameter(anEllipse, aFAttach);
|
Standard_Real pFAttach = ElCLib::Parameter(anEllipse, aFAttach);
|
||||||
Standard_Real pSAttach = ElCLib::Parameter(anEllipse, aSAttach);
|
Standard_Real pSAttach = ElCLib::Parameter(anEllipse, aSAttach);
|
||||||
Standard_Real alpha = pSAttach - pFAttach;
|
Standard_Real alpha = pSAttach - pFAttach;
|
||||||
if ( alpha < 0 ) alpha += 2 * M_PI;
|
if ( alpha < 0 ) alpha += 2. * M_PI;
|
||||||
Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
|
const Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
|
||||||
Standard_Integer nbp = Max (4 , nb);
|
const Standard_Integer nbp = Max (4, nb);
|
||||||
Graphic3d_Array1OfVertex V(1,nbp);
|
const Standard_Real dteta = alpha/(nbp-1);
|
||||||
Standard_Real dteta = alpha/(nbp-1);
|
|
||||||
gp_Pnt ptcur;
|
|
||||||
for (Standard_Integer i = 1; i<=nbp; i++)
|
|
||||||
{
|
|
||||||
ptcur = ElCLib::Value(pFAttach + dteta*(i-1),anEllipse);
|
|
||||||
V(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
|
|
||||||
}
|
|
||||||
|
|
||||||
// trait de cote
|
Handle(Graphic3d_ArrayOfPolylines) aPrims;
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// trait joignant aPntOffset
|
// trait joignant aPntOffset
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Graphic3d_Array1OfVertex V2(1,2);
|
|
||||||
|
|
||||||
if ( ! aPntOnElli.IsEqual(aPntOffset, Precision::Confusion()) )
|
if ( ! aPntOnElli.IsEqual(aPntOffset, Precision::Confusion()) )
|
||||||
{
|
{
|
||||||
V2(1).SetCoord(aPntOffset.X(), aPntOffset.Y(), aPntOffset.Z());
|
aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
|
||||||
V2(2).SetCoord(aPntOnElli.X(), aPntOnElli.Y(), aPntOnElli.Z());
|
aPrims->AddBound(2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V2);
|
aPrims->AddVertex(aPntOffset);
|
||||||
}
|
aPrims->AddVertex(aPntOnElli);
|
||||||
|
aPrims->AddBound(nbp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
aPrims = new Graphic3d_ArrayOfPolylines(nbp);
|
||||||
|
|
||||||
|
for (Standard_Integer i = 1; i<=nbp; i++)
|
||||||
|
aPrims->AddVertex(ElCLib::Value(pFAttach + dteta*(i-1),anEllipse));
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// texte
|
// texte
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,aPntOffset);
|
||||||
|
@ -22,7 +22,8 @@
|
|||||||
#include <ElCLib.hxx>
|
#include <ElCLib.hxx>
|
||||||
#include <gce_MakeLin.hxx>
|
#include <gce_MakeLin.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
#include <Prs3d_Arrow.hxx>
|
#include <Prs3d_Arrow.hxx>
|
||||||
#include <Prs3d_ArrowAspect.hxx>
|
#include <Prs3d_ArrowAspect.hxx>
|
||||||
@ -53,17 +54,12 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
{
|
{
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
gp_Lin L1 (AttachmentPoint1,aDirection);
|
gp_Lin L1 (AttachmentPoint1,aDirection);
|
||||||
gp_Lin L2 (AttachmentPoint2,aDirection);
|
gp_Lin L2 (AttachmentPoint2,aDirection);
|
||||||
gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1);
|
gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1);
|
||||||
gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L2,OffsetPoint),L2);
|
gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L2,OffsetPoint),L2);
|
||||||
gp_Lin L3;
|
gp_Lin L3 = Proj1.IsEqual(Proj2,Precision::Confusion())? gp_Lin(Proj1,aDirection) : gce_MakeLin(Proj1,Proj2);
|
||||||
if (!Proj1.IsEqual(Proj2,Precision::Confusion())) {
|
|
||||||
L3 = gce_MakeLin(Proj1,Proj2);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
L3 = gp_Lin(Proj1,aDirection);
|
|
||||||
}
|
|
||||||
Standard_Real parmin,parmax,parcur;
|
Standard_Real parmin,parmax,parcur;
|
||||||
parmin = ElCLib::Parameter(L3,Proj1);
|
parmin = ElCLib::Parameter(L3,Proj1);
|
||||||
parmax = parmin;
|
parmax = parmin;
|
||||||
@ -87,67 +83,43 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
||||||
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
|
|
||||||
Quantity_Length X,Y,Z;
|
|
||||||
|
|
||||||
PointMin.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
PointMax.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
// face processing : 1st group
|
// face processing : 1st group
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
|
||||||
|
aPrims->AddVertex(PointMin);
|
||||||
|
aPrims->AddVertex(PointMax);
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length()))
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
|
|
||||||
if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) {
|
|
||||||
outside = Standard_True;
|
outside = Standard_True;
|
||||||
}
|
|
||||||
gp_Dir arrdir = L3.Direction().Reversed();
|
|
||||||
|
|
||||||
if (outside) {
|
gp_Dir arrdir = L3.Direction().Reversed();
|
||||||
|
if (outside)
|
||||||
arrdir.Reverse();
|
arrdir.Reverse();
|
||||||
}
|
|
||||||
// arrow 1 : 2nd group
|
// arrow 1 : 2nd group
|
||||||
Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir,
|
Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir, LA->Arrow1Aspect()->Angle(), LA->Arrow1Aspect()->Length());
|
||||||
LA->Arrow1Aspect()->Angle(),
|
|
||||||
LA->Arrow1Aspect()->Length());
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
// arrow 2 : 3rd group
|
// arrow 2 : 3rd group
|
||||||
Prs3d_Arrow::Draw(aPresentation,Proj2,arrdir.Reversed(),
|
Prs3d_Arrow::Draw(aPresentation,Proj2,arrdir.Reversed(), LA->Arrow2Aspect()->Angle(), LA->Arrow2Aspect()->Length());
|
||||||
LA->Arrow2Aspect()->Angle(),
|
|
||||||
LA->Arrow2Aspect()->Length());
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
|
||||||
// text : 4th group
|
// text : 4th group
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
|
||||||
|
|
||||||
AttachmentPoint1.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
Proj1.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
// processing of call 1 : 5th group
|
// processing of call 1 : 5th group
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
|
aPrims->AddVertex(Proj1);
|
||||||
|
|
||||||
AttachmentPoint2.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
Proj2.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
// processing of call 2 : 6th group
|
// processing of call 2 : 6th group
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
|
aPrims->AddVertex(Proj2);
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
|
|
||||||
//==================================================================================
|
//==================================================================================
|
||||||
@ -181,7 +153,6 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
EndOfArrow1,
|
EndOfArrow1,
|
||||||
EndOfArrow2,
|
EndOfArrow2,
|
||||||
DirOfArrow1 );
|
DirOfArrow1 );
|
||||||
Graphic3d_Array1OfVertex VertexArray( 1, 2 );
|
|
||||||
|
|
||||||
// Parameters for length's line
|
// Parameters for length's line
|
||||||
gp_Lin LengthLine( OffsetPoint, DirOfArrow1 );
|
gp_Lin LengthLine( OffsetPoint, DirOfArrow1 );
|
||||||
@ -189,42 +160,37 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
Standard_Real Par2 = ElCLib::Parameter( LengthLine, EndOfArrow2 );
|
Standard_Real Par2 = ElCLib::Parameter( LengthLine, EndOfArrow2 );
|
||||||
gp_Pnt FirstPoint, LastPoint;
|
gp_Pnt FirstPoint, LastPoint;
|
||||||
if (Par1 > 0.0 && Par2 > 0.0 || Par1 < 0.0 && Par2 < 0.0)
|
if (Par1 > 0.0 && Par2 > 0.0 || Par1 < 0.0 && Par2 < 0.0)
|
||||||
{
|
{
|
||||||
FirstPoint = OffsetPoint;
|
FirstPoint = OffsetPoint;
|
||||||
LastPoint = (Abs( Par1 ) > Abs( Par2 ))? EndOfArrow1 : EndOfArrow2;
|
LastPoint = (Abs( Par1 ) > Abs( Par2 ))? EndOfArrow1 : EndOfArrow2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FirstPoint = EndOfArrow1;
|
FirstPoint = EndOfArrow1;
|
||||||
LastPoint = EndOfArrow2;
|
LastPoint = EndOfArrow2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creating the length's line
|
// Creating the length's line
|
||||||
VertexArray(1).SetCoord( FirstPoint.X(), FirstPoint.Y(), FirstPoint.Z() );
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
|
||||||
VertexArray(2).SetCoord( LastPoint.X(), LastPoint.Y(), LastPoint.Z() );
|
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
|
aPrims->AddVertex(FirstPoint);
|
||||||
|
aPrims->AddVertex(LastPoint);
|
||||||
|
|
||||||
// Add presentation of arrows
|
// Add presentation of arrows
|
||||||
DsgPrs::ComputeSymbol( aPresentation, LA,
|
DsgPrs::ComputeSymbol( aPresentation, LA, EndOfArrow1, EndOfArrow2, DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs );
|
||||||
EndOfArrow1, EndOfArrow2, //EndOfArrow1,
|
|
||||||
DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs );
|
|
||||||
|
|
||||||
// Drawing the text
|
// Drawing the text
|
||||||
Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, OffsetPoint );
|
Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, OffsetPoint );
|
||||||
|
|
||||||
// Line from AttachmentPoint1 to end of Arrow1
|
// Line from AttachmentPoint1 to end of Arrow1
|
||||||
VertexArray(1).SetCoord(AttachmentPoint1.X(),
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
AttachmentPoint1.Y(),
|
aPrims->AddVertex(EndOfArrow1);
|
||||||
AttachmentPoint1.Z());
|
|
||||||
VertexArray(2).SetCoord( EndOfArrow1.X(), EndOfArrow1.Y(), EndOfArrow1.Z() );
|
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
|
|
||||||
|
|
||||||
// Line from AttachmentPoint2 to end of Arrow2
|
// Line from AttachmentPoint2 to end of Arrow2
|
||||||
VertexArray(1).SetCoord(AttachmentPoint2.X(),
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
AttachmentPoint2.Y(),
|
aPrims->AddVertex(EndOfArrow2);
|
||||||
AttachmentPoint2.Z());
|
|
||||||
VertexArray(2).SetCoord( EndOfArrow2.X(), EndOfArrow2.Y(), EndOfArrow2.Z() );
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -249,13 +215,7 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
gp_Lin L2 (AttachmentPoint2,aDirection);
|
gp_Lin L2 (AttachmentPoint2,aDirection);
|
||||||
gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1);
|
gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1);
|
||||||
gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L2,OffsetPoint),L2);
|
gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L2,OffsetPoint),L2);
|
||||||
gp_Lin L3;
|
gp_Lin L3 = Proj1.IsEqual(Proj2,Precision::Confusion())? gp_Lin(Proj1,aDirection) : gce_MakeLin(Proj1,Proj2);
|
||||||
if (!Proj1.IsEqual(Proj2,Precision::Confusion())) {
|
|
||||||
L3 = gce_MakeLin(Proj1,Proj2);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
L3 = gp_Lin(Proj1,aDirection);
|
|
||||||
}
|
|
||||||
Standard_Real parmin,parmax,parcur;
|
Standard_Real parmin,parmax,parcur;
|
||||||
parmin = ElCLib::Parameter(L3,Proj1);
|
parmin = ElCLib::Parameter(L3,Proj1);
|
||||||
parmax = parmin;
|
parmax = parmin;
|
||||||
@ -279,46 +239,28 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
||||||
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
|
|
||||||
Quantity_Length X,Y,Z;
|
|
||||||
|
|
||||||
PointMin.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
PointMax.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
// processing of face
|
// processing of face
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
|
||||||
|
|
||||||
|
aPrims->AddVertex(PointMin);
|
||||||
|
aPrims->AddVertex(PointMax);
|
||||||
|
|
||||||
if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) {
|
if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length()))
|
||||||
outside = Standard_True;
|
outside = Standard_True;
|
||||||
}
|
|
||||||
gp_Dir arrdir = L3.Direction().Reversed();
|
gp_Dir arrdir = L3.Direction().Reversed();
|
||||||
|
if (outside)
|
||||||
if (outside) {
|
|
||||||
arrdir.Reverse();
|
arrdir.Reverse();
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AttachmentPoint1.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
Proj1.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
// processing of call 1
|
// processing of call 1
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
|
aPrims->AddVertex(Proj1);
|
||||||
AttachmentPoint2.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
Proj2.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
// processing of call 2
|
// processing of call 2
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
|
aPrims->AddVertex(Proj2);
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// text
|
// text
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
|
||||||
@ -328,7 +270,6 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//==================================================================================
|
//==================================================================================
|
||||||
//function : Add
|
//function : Add
|
||||||
//purpose : Adds presentation of length dimension between two curvilinear faces
|
//purpose : Adds presentation of length dimension between two curvilinear faces
|
||||||
@ -365,32 +306,29 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
FirstU, deltaU,
|
FirstU, deltaU,
|
||||||
FirstV, deltaV );
|
FirstV, deltaV );
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex VertexArray( 1, 2 );
|
|
||||||
|
|
||||||
gp_Lin LengthLine( OffsetPoint, DirOfArrow1 );
|
gp_Lin LengthLine( OffsetPoint, DirOfArrow1 );
|
||||||
Standard_Real Par1 = ElCLib::Parameter( LengthLine, AttachmentPoint1 );
|
Standard_Real Par1 = ElCLib::Parameter( LengthLine, AttachmentPoint1 );
|
||||||
Standard_Real Par2 = ElCLib::Parameter( LengthLine, EndOfArrow2 );
|
Standard_Real Par2 = ElCLib::Parameter( LengthLine, EndOfArrow2 );
|
||||||
gp_Pnt FirstPoint, LastPoint;
|
gp_Pnt FirstPoint, LastPoint;
|
||||||
if (Par1 > 0.0 && Par2 > 0.0 || Par1 < 0.0 && Par2 < 0.0)
|
if (Par1 > 0.0 && Par2 > 0.0 || Par1 < 0.0 && Par2 < 0.0)
|
||||||
{
|
{
|
||||||
FirstPoint = OffsetPoint;
|
FirstPoint = OffsetPoint;
|
||||||
LastPoint = (Abs( Par1 ) > Abs( Par2 ))? AttachmentPoint1 : EndOfArrow2;
|
LastPoint = (Abs( Par1 ) > Abs( Par2 ))? AttachmentPoint1 : EndOfArrow2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FirstPoint = AttachmentPoint1;
|
FirstPoint = AttachmentPoint1;
|
||||||
LastPoint = EndOfArrow2;
|
LastPoint = EndOfArrow2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Creating the length's line
|
// Creating the length's line
|
||||||
VertexArray(1).SetCoord( FirstPoint.X(), FirstPoint.Y(), FirstPoint.Z() );
|
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
VertexArray(2).SetCoord( LastPoint.X(), LastPoint.Y(), LastPoint.Z() );
|
aPrims->AddVertex(FirstPoint);
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
|
aPrims->AddVertex(LastPoint);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// Add presentation of arrows
|
// Add presentation of arrows
|
||||||
DsgPrs::ComputeSymbol( aPresentation, LA,
|
DsgPrs::ComputeSymbol( aPresentation, LA, AttachmentPoint1, EndOfArrow2, DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs );
|
||||||
AttachmentPoint1, EndOfArrow2,
|
|
||||||
DirOfArrow1, DirOfArrow1.Reversed(), ArrowPrs );
|
|
||||||
|
|
||||||
// Drawing the text
|
// Drawing the text
|
||||||
Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, OffsetPoint );
|
Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, OffsetPoint );
|
||||||
@ -401,41 +339,27 @@ void DsgPrs_LengthPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
|
|
||||||
Alpha = Abs( deltaU );
|
Alpha = Abs( deltaU );
|
||||||
if (Alpha > Precision::Angular() && Alpha<Precision::Infinite())
|
if (Alpha > Precision::Angular() && Alpha<Precision::Infinite())
|
||||||
{
|
{
|
||||||
NodeNumber = Max( 4 , Standard_Integer (50. * Alpha / M_PI) );
|
NodeNumber = Max( 4 , Standard_Integer (50. * Alpha / M_PI) );
|
||||||
Graphic3d_Array1OfVertex ApproxCurve( 1, NodeNumber );
|
delta = deltaU / (Standard_Real)( NodeNumber - 1 );
|
||||||
delta = deltaU / (Standard_Real)( NodeNumber - 1 );
|
aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
|
||||||
gp_Pnt CurPnt;
|
for (Standard_Integer i = 1; i <= NodeNumber; i++, FirstU += delta)
|
||||||
for (Standard_Integer i = 1; i <= NodeNumber; i++)
|
aPrims->AddVertex(VCurve->Value( FirstU ));
|
||||||
{
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
CurPnt = VCurve->Value( FirstU );
|
}
|
||||||
ApproxCurve(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
|
|
||||||
FirstU += delta;
|
|
||||||
}
|
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxCurve );
|
|
||||||
}
|
|
||||||
Alpha = Abs( deltaV );
|
Alpha = Abs( deltaV );
|
||||||
if (Alpha > Precision::Angular() && Alpha<Precision::Infinite())
|
if (Alpha > Precision::Angular() && Alpha<Precision::Infinite())
|
||||||
{
|
{
|
||||||
NodeNumber = Max( 4 , Standard_Integer (50. * Alpha / M_PI) );
|
NodeNumber = Max( 4 , Standard_Integer (50. * Alpha / M_PI) );
|
||||||
Graphic3d_Array1OfVertex ApproxCurve( 1, NodeNumber );
|
delta = deltaV / (Standard_Real)( NodeNumber - 1 );
|
||||||
delta = deltaV / (Standard_Real)( NodeNumber - 1 );
|
aPrims = new Graphic3d_ArrayOfPolylines(NodeNumber);
|
||||||
gp_Pnt CurPnt;
|
for (Standard_Integer i = 1; i <= NodeNumber; i++, FirstV += delta)
|
||||||
for (Standard_Integer i = 1; i <= NodeNumber; i++)
|
aPrims->AddVertex(UCurve->Value( FirstV ));
|
||||||
{
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
CurPnt = UCurve->Value( FirstV );
|
}
|
||||||
ApproxCurve(i).SetCoord( CurPnt.X(), CurPnt.Y(), CurPnt.Z() );
|
|
||||||
FirstV += delta;
|
|
||||||
}
|
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( ApproxCurve );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//================================
|
//================================
|
||||||
// Function:
|
// Function:
|
||||||
// Purpose: Rob 26-mar-96
|
// Purpose: Rob 26-mar-96
|
||||||
@ -447,27 +371,25 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPrs,
|
|||||||
const gp_Pnt& Pt2,
|
const gp_Pnt& Pt2,
|
||||||
const DsgPrs_ArrowSide ArrowPrs)
|
const DsgPrs_ArrowSide ArrowPrs)
|
||||||
{
|
{
|
||||||
Prs3d_Root::CurrentGroup(aPrs)->BeginPrimitives();
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
Graphic3d_Array1OfVertex Vx(1,2);
|
aPrims->AddVertex(Pt1);
|
||||||
Vx(1).SetCoord(Pt1.X(),Pt1.Y(),Pt1.Z());
|
aPrims->AddVertex(Pt2);
|
||||||
Vx(2).SetCoord(Pt2.X(),Pt2.Y(),Pt2.Z());
|
Prs3d_Root::CurrentGroup(aPrs)->AddPrimitiveArray(aPrims);
|
||||||
Prs3d_Root::CurrentGroup(aPrs)->Polyline(Vx);
|
|
||||||
|
|
||||||
gp_Vec V ;
|
gp_Vec V ;
|
||||||
switch(ArrowPrs){
|
switch(ArrowPrs)
|
||||||
case DsgPrs_AS_NONE:
|
{
|
||||||
break;
|
case DsgPrs_AS_LASTAR:
|
||||||
case DsgPrs_AS_LASTAR:
|
|
||||||
Prs3d_Arrow::Draw(aPrs,Pt2,gp_Dir(gp_Vec(Pt1,Pt2)),
|
Prs3d_Arrow::Draw(aPrs,Pt2,gp_Dir(gp_Vec(Pt1,Pt2)),
|
||||||
aDrawer->LengthAspect()->Arrow1Aspect()->Angle(),
|
aDrawer->LengthAspect()->Arrow1Aspect()->Angle(),
|
||||||
aDrawer->LengthAspect()->Arrow1Aspect()->Length());
|
aDrawer->LengthAspect()->Arrow1Aspect()->Length());
|
||||||
break;
|
break;
|
||||||
case DsgPrs_AS_FIRSTAR:
|
case DsgPrs_AS_FIRSTAR:
|
||||||
Prs3d_Arrow::Draw(aPrs,Pt1,gp_Dir(gp_Vec(Pt2,Pt1)),
|
Prs3d_Arrow::Draw(aPrs,Pt1,gp_Dir(gp_Vec(Pt2,Pt1)),
|
||||||
aDrawer->LengthAspect()->Arrow1Aspect()->Angle(),
|
aDrawer->LengthAspect()->Arrow1Aspect()->Angle(),
|
||||||
aDrawer->LengthAspect()->Arrow1Aspect()->Length());
|
aDrawer->LengthAspect()->Arrow1Aspect()->Length());
|
||||||
break;
|
break;
|
||||||
case DsgPrs_AS_BOTHAR:
|
case DsgPrs_AS_BOTHAR:
|
||||||
V = gp_Vec(Pt1,Pt2);
|
V = gp_Vec(Pt1,Pt2);
|
||||||
Prs3d_Arrow::Draw(aPrs,Pt2,gp_Dir(V),
|
Prs3d_Arrow::Draw(aPrs,Pt2,gp_Dir(V),
|
||||||
aDrawer->LengthAspect()->Arrow1Aspect()->Angle(),
|
aDrawer->LengthAspect()->Arrow1Aspect()->Angle(),
|
||||||
@ -476,9 +398,7 @@ void DsgPrs_LengthPresentation::Add (const Handle(Prs3d_Presentation)& aPrs,
|
|||||||
aDrawer->LengthAspect()->Arrow1Aspect()->Angle(),
|
aDrawer->LengthAspect()->Arrow1Aspect()->Angle(),
|
||||||
aDrawer->LengthAspect()->Arrow1Aspect()->Length());
|
aDrawer->LengthAspect()->Arrow1Aspect()->Length());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Prs3d_Root::CurrentGroup(aPrs)->EndPrimitives();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_MidPointPresentation.ixx>
|
#include <DsgPrs_MidPointPresentation.ixx>
|
||||||
|
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
@ -35,7 +34,8 @@
|
|||||||
#include <ElCLib.hxx>
|
#include <ElCLib.hxx>
|
||||||
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
|
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
@ -58,61 +58,52 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
Standard_Real rad = AttachPoint.Distance(MidPoint)/20.0;
|
Standard_Real rad = AttachPoint.Distance(MidPoint)/20.0;
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
|
|
||||||
gp_Pnt Ptmp;
|
|
||||||
|
|
||||||
gp_Ax2 ax = theAxe;
|
gp_Ax2 ax = theAxe;
|
||||||
ax.SetLocation(MidPoint);
|
ax.SetLocation(MidPoint);
|
||||||
gp_Circ aCircleM (ax,rad);
|
gp_Circ aCircleM (ax,rad);
|
||||||
|
|
||||||
if ( first )
|
if ( first )
|
||||||
{
|
{
|
||||||
// center of the symmetry - circle around the MidPoint
|
// center of the symmetry - circle around the MidPoint
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
Standard_Real alpha = 2 * M_PI;
|
|
||||||
Standard_Integer nbp = 100;
|
|
||||||
Graphic3d_Array1OfVertex VC(1,nbp);
|
|
||||||
Standard_Real dteta = alpha/(nbp-1);
|
|
||||||
gp_Pnt ptcur;
|
|
||||||
for (Standard_Integer i = 1; i <= nbp; i++)
|
|
||||||
{
|
|
||||||
ptcur = ElCLib::Value(dteta*(i-1),aCircleM);
|
|
||||||
VC(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
|
|
||||||
}
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VC);
|
|
||||||
|
|
||||||
// segment from mid point to the text position
|
const Standard_Real alpha = 2. * M_PI;
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
const Standard_Integer nbp = 100;
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
const Standard_Real dteta = alpha/(nbp-1);
|
||||||
// mid point
|
|
||||||
if ( Position.IsEqual(MidPoint,rad) )
|
|
||||||
Ptmp = MidPoint;
|
|
||||||
else
|
|
||||||
Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM);
|
|
||||||
V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
|
|
||||||
// text position
|
|
||||||
V(2).SetCoord(Position.X(),Position.Y(),Position.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// texte
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
|
||||||
TCollection_ExtendedString aText (" (+)");
|
aPrims->AddBound(nbp);
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
|
for (Standard_Integer i = 1; i <= nbp; i++)
|
||||||
}
|
aPrims->AddVertex(ElCLib::Value(dteta*(i-1),aCircleM));
|
||||||
|
|
||||||
|
// segment from mid point to the text position
|
||||||
|
aPrims->AddBound(2);
|
||||||
|
aPrims->AddVertex(Position.IsEqual(MidPoint,rad)? MidPoint : ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM)); // mid point
|
||||||
|
aPrims->AddVertex(Position); // text position
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
|
// texte
|
||||||
|
TCollection_ExtendedString aText(" (+)");
|
||||||
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
|
||||||
|
}
|
||||||
|
|
||||||
if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
|
if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
|
||||||
|
{
|
||||||
|
if ( !first )
|
||||||
{
|
{
|
||||||
// segment from mid point to the geometry
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
// mid point
|
|
||||||
Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM);
|
|
||||||
V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
|
|
||||||
// attach point to the geometry
|
|
||||||
V(2).SetCoord(AttachPoint.X(),AttachPoint.Y(),AttachPoint.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// segment from mid point to the geometry
|
||||||
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM)); // mid point
|
||||||
|
aPrims->AddVertex(AttachPoint); // attach point to the geometry
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//===================================================================
|
//===================================================================
|
||||||
@ -133,68 +124,52 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
if ( rad <= Precision::Confusion() ) rad = Point1.Distance(Point2)/20.0;
|
if ( rad <= Precision::Confusion() ) rad = Point1.Distance(Point2)/20.0;
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
|
|
||||||
gp_Pnt Ptmp;
|
|
||||||
|
|
||||||
gp_Ax2 ax = theAxe;
|
gp_Ax2 ax = theAxe;
|
||||||
ax.SetLocation(MidPoint);
|
ax.SetLocation(MidPoint);
|
||||||
gp_Circ aCircleM (ax,rad);
|
gp_Circ aCircleM (ax,rad);
|
||||||
|
|
||||||
if ( first )
|
|
||||||
{
|
|
||||||
// center of the symmetry - circle around the MidPoint
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Standard_Real alpha = 2 * M_PI;
|
|
||||||
Standard_Integer nbp = 100;
|
|
||||||
Graphic3d_Array1OfVertex VC(1,nbp);
|
|
||||||
Standard_Real dteta = alpha/(nbp-1);
|
|
||||||
gp_Pnt ptcur;
|
|
||||||
for (Standard_Integer i = 1; i <= nbp; i++)
|
|
||||||
{
|
|
||||||
ptcur = ElCLib::Value(dteta*(i-1),aCircleM);
|
|
||||||
VC(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
|
|
||||||
}
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VC);
|
|
||||||
|
|
||||||
// segment from mid point to the text position
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
// mid point
|
|
||||||
if ( Position.IsEqual(MidPoint,rad) )
|
|
||||||
Ptmp = MidPoint;
|
|
||||||
else
|
|
||||||
Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM);
|
|
||||||
V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
|
|
||||||
// text position
|
|
||||||
V(2).SetCoord(Position.X(),Position.Y(),Position.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// texte
|
|
||||||
TCollection_ExtendedString aText (" (+)");
|
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
|
|
||||||
{
|
|
||||||
// segment from mid point to the geometry
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
// mid point
|
|
||||||
Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM);
|
|
||||||
V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
|
|
||||||
// attach point to the geometry
|
|
||||||
V(2).SetCoord(AttachPoint.X(),AttachPoint.Y(),AttachPoint.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
}
|
|
||||||
|
|
||||||
// segment on line
|
// segment on line
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
V(1).SetCoord(Point1.X(),Point1.Y(),Point1.Z());
|
|
||||||
V(2).SetCoord(Point2.X(),Point2.Y(),Point2.Z());
|
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(Point1);
|
||||||
|
aPrims->AddVertex(Point2);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
|
if ( first )
|
||||||
|
{
|
||||||
|
// center of the symmetry - circle around the MidPoint
|
||||||
|
const Standard_Real alpha = 2. * M_PI;
|
||||||
|
const Standard_Integer nbp = 100;
|
||||||
|
const Standard_Real dteta = alpha/(nbp-1);
|
||||||
|
|
||||||
|
aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
|
||||||
|
aPrims->AddBound(nbp);
|
||||||
|
for (Standard_Integer i = 1; i <= nbp; i++)
|
||||||
|
aPrims->AddVertex(ElCLib::Value(dteta*(i-1),aCircleM));
|
||||||
|
|
||||||
|
// segment from mid point to the text position
|
||||||
|
aPrims->AddBound(2);
|
||||||
|
aPrims->AddVertex(Position.IsEqual(MidPoint,rad)? MidPoint : ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM)); // mid point
|
||||||
|
aPrims->AddVertex(Position); // text position
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
|
// texte
|
||||||
|
TCollection_ExtendedString aText (" (+)");
|
||||||
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
|
||||||
|
{
|
||||||
|
// mid point
|
||||||
|
aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM));
|
||||||
|
aPrims->AddVertex(AttachPoint); // attach point to the geometry
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//===================================================================
|
//===================================================================
|
||||||
@ -215,79 +190,60 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
if ( rad <= Precision::Confusion() ) rad = Point1.Distance(Point2)/20.0;
|
if ( rad <= Precision::Confusion() ) rad = Point1.Distance(Point2)/20.0;
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
|
|
||||||
gp_Pnt Ptmp,ptcur;
|
|
||||||
|
|
||||||
gp_Ax2 ax = aCircle.Position();
|
gp_Ax2 ax = aCircle.Position();
|
||||||
ax.SetLocation(MidPoint);
|
ax.SetLocation(MidPoint);
|
||||||
gp_Circ aCircleM (ax,rad);
|
gp_Circ aCircleM (ax,rad);
|
||||||
|
|
||||||
if ( first )
|
|
||||||
{
|
|
||||||
// center of the symmetry - circle around the MidPoint
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Standard_Real alpha = 2 * M_PI;
|
|
||||||
Standard_Integer nbp = 100;
|
|
||||||
Graphic3d_Array1OfVertex VC(1,nbp);
|
|
||||||
Standard_Real dteta = alpha/(nbp-1);
|
|
||||||
for (Standard_Integer i = 1; i <= nbp; i++)
|
|
||||||
{
|
|
||||||
ptcur = ElCLib::Value(dteta*(i-1),aCircleM);
|
|
||||||
VC(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
|
|
||||||
}
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VC);
|
|
||||||
|
|
||||||
// segment from mid point to the text position
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
// mid point
|
|
||||||
if ( Position.IsEqual(MidPoint,rad) )
|
|
||||||
Ptmp = MidPoint;
|
|
||||||
else
|
|
||||||
Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM);
|
|
||||||
V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
|
|
||||||
// text position
|
|
||||||
V(2).SetCoord(Position.X(),Position.Y(),Position.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// texte
|
|
||||||
TCollection_ExtendedString aText (" (+)");
|
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
|
|
||||||
{
|
|
||||||
// segment from mid point to the geometry
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
// mid point
|
|
||||||
Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM);
|
|
||||||
V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
|
|
||||||
// attach point to the geometry
|
|
||||||
V(2).SetCoord(AttachPoint.X(),AttachPoint.Y(),AttachPoint.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
}
|
|
||||||
|
|
||||||
// segment on circle
|
// segment on circle
|
||||||
Standard_Real pf = ElCLib::Parameter(aCircle,Point1);
|
|
||||||
Standard_Real pl = ElCLib::Parameter(aCircle,Point2);
|
|
||||||
Standard_Real alpha = pl - pf;
|
|
||||||
if ( alpha < 0 ) alpha += 2 * M_PI;
|
|
||||||
Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
|
|
||||||
Standard_Integer nbp = Max(4,nb);
|
|
||||||
Graphic3d_Array1OfVertex VC1(1,nbp);
|
|
||||||
Standard_Real dteta = alpha/(nbp-1);
|
|
||||||
|
|
||||||
for (Standard_Integer i = 1; i <= nbp; i++)
|
|
||||||
{
|
|
||||||
ptcur = ElCLib::Value(pf + dteta*(i-1),aCircle);
|
|
||||||
VC1(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
|
|
||||||
}
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VC1);
|
|
||||||
|
const Standard_Real pf = ElCLib::Parameter(aCircle,Point1);
|
||||||
|
const Standard_Real pl = ElCLib::Parameter(aCircle,Point2);
|
||||||
|
Standard_Real alpha = pl - pf;
|
||||||
|
if ( alpha < 0 ) alpha += 2. * M_PI;
|
||||||
|
const Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
|
||||||
|
Standard_Integer nbp = Max(4,nb);
|
||||||
|
Standard_Real dteta = alpha/(nbp-1);
|
||||||
|
|
||||||
|
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines(nbp);
|
||||||
|
for (Standard_Integer i = 1; i <= nbp; i++)
|
||||||
|
aPrims->AddVertex(ElCLib::Value(pf + dteta*(i-1),aCircle));
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
|
if ( first )
|
||||||
|
{
|
||||||
|
// center of the symmetry - circle around the MidPoint
|
||||||
|
alpha = 2. * M_PI;
|
||||||
|
nbp = 100;
|
||||||
|
dteta = alpha/(nbp-1);
|
||||||
|
|
||||||
|
aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
|
||||||
|
aPrims->AddBound(nbp);
|
||||||
|
for (Standard_Integer i = 1; i <= nbp; i++)
|
||||||
|
aPrims->AddVertex(ElCLib::Value(dteta*(i-1),aCircleM));
|
||||||
|
|
||||||
|
// segment from mid point to the text position
|
||||||
|
aPrims->AddBound(2);
|
||||||
|
aPrims->AddVertex(Position.IsEqual(MidPoint,rad)? MidPoint : ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM)); // mid point
|
||||||
|
aPrims->AddVertex(Position); // text position
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
|
// texte
|
||||||
|
TCollection_ExtendedString aText (" (+)");
|
||||||
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
|
||||||
|
{
|
||||||
|
// segment from mid point to the geometry
|
||||||
|
aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM)); // mid point
|
||||||
|
aPrims->AddVertex(AttachPoint); // attach point to the geometry
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//===================================================================
|
//===================================================================
|
||||||
@ -308,7 +264,6 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
if ( rad <= Precision::Confusion() ) rad = Point1.Distance(Point2)/20.0;
|
if ( rad <= Precision::Confusion() ) rad = Point1.Distance(Point2)/20.0;
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
|
|
||||||
gp_Pnt Ptmp,ptcur;
|
gp_Pnt Ptmp,ptcur;
|
||||||
|
|
||||||
@ -316,69 +271,53 @@ void DsgPrs_MidPointPresentation::Add (const Handle(Prs3d_Presentation)& aPresen
|
|||||||
ax.SetLocation(MidPoint);
|
ax.SetLocation(MidPoint);
|
||||||
gp_Circ aCircleM (ax,rad);
|
gp_Circ aCircleM (ax,rad);
|
||||||
|
|
||||||
if ( first )
|
|
||||||
{
|
|
||||||
// center of the symmetry - circle around the MidPoint
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Standard_Real alpha = 2 * M_PI;
|
|
||||||
Standard_Integer nbp = 100;
|
|
||||||
Graphic3d_Array1OfVertex VC(1,nbp);
|
|
||||||
Standard_Real dteta = alpha/(nbp-1);
|
|
||||||
for (Standard_Integer i = 1; i <= nbp; i++)
|
|
||||||
{
|
|
||||||
ptcur = ElCLib::Value(dteta*(i-1),aCircleM);
|
|
||||||
VC(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
|
|
||||||
}
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VC);
|
|
||||||
|
|
||||||
// segment from mid point to the text position
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
// mid point
|
|
||||||
if ( Position.IsEqual(MidPoint,rad) )
|
|
||||||
Ptmp = MidPoint;
|
|
||||||
else
|
|
||||||
Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM);
|
|
||||||
V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
|
|
||||||
// text position
|
|
||||||
V(2).SetCoord(Position.X(),Position.Y(),Position.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// texte
|
|
||||||
TCollection_ExtendedString aText (" (+)");
|
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
|
|
||||||
{
|
|
||||||
// segment from mid point to the geometry
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
// mid point
|
|
||||||
Ptmp = ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM);
|
|
||||||
V(1).SetCoord(Ptmp.X(),Ptmp.Y(),Ptmp.Z());
|
|
||||||
// attach point to the geometry
|
|
||||||
V(2).SetCoord(AttachPoint.X(),AttachPoint.Y(),AttachPoint.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
}
|
|
||||||
|
|
||||||
// segment on ellipse
|
// segment on ellipse
|
||||||
Standard_Real pf = ElCLib::Parameter(aCircle,Point1);
|
|
||||||
Standard_Real pl = ElCLib::Parameter(aCircle,Point2);
|
|
||||||
Standard_Real alpha = pl - pf;
|
|
||||||
if ( alpha < 0 ) alpha += 2 * M_PI;
|
|
||||||
Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
|
|
||||||
Standard_Integer nbp = Max(4,nb);
|
|
||||||
Graphic3d_Array1OfVertex VC1(1,nbp);
|
|
||||||
Standard_Real dteta = alpha/(nbp-1);
|
|
||||||
|
|
||||||
for (Standard_Integer i = 1; i <= nbp; i++)
|
|
||||||
{
|
|
||||||
ptcur = ElCLib::Value(pf + dteta*(i-1),aCircle);
|
|
||||||
VC1(i).SetCoord(ptcur.X(),ptcur.Y(),ptcur.Z());
|
|
||||||
}
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VC1);
|
|
||||||
|
const Standard_Real pf = ElCLib::Parameter(aCircle,Point1);
|
||||||
|
const Standard_Real pl = ElCLib::Parameter(aCircle,Point2);
|
||||||
|
Standard_Real alpha = pl - pf;
|
||||||
|
if ( alpha < 0 ) alpha += 2 * M_PI;
|
||||||
|
const Standard_Integer nb = (Standard_Integer)(50.0*alpha/M_PI);
|
||||||
|
Standard_Integer nbp = Max(4,nb);
|
||||||
|
Standard_Real dteta = alpha/(nbp-1);
|
||||||
|
|
||||||
|
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines(nbp);
|
||||||
|
for (Standard_Integer i = 1; i <= nbp; i++)
|
||||||
|
aPrims->AddVertex(ElCLib::Value(pf + dteta*(i-1),aCircle));
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
|
if ( first )
|
||||||
|
{
|
||||||
|
// center of the symmetry - circle around the MidPoint
|
||||||
|
alpha = 2. * M_PI;
|
||||||
|
nbp = 100;
|
||||||
|
dteta = alpha/(nbp-1);
|
||||||
|
|
||||||
|
aPrims = new Graphic3d_ArrayOfPolylines(nbp+2,2);
|
||||||
|
aPrims->AddBound(nbp);
|
||||||
|
for (Standard_Integer i = 1; i <= nbp; i++)
|
||||||
|
aPrims->AddVertex(ElCLib::Value(dteta*(i-1),aCircleM));
|
||||||
|
|
||||||
|
// segment from mid point to the text position
|
||||||
|
aPrims->AddBound(2);
|
||||||
|
aPrims->AddVertex(Position.IsEqual(MidPoint,rad)? MidPoint : ElCLib::Value(ElCLib::Parameter(aCircleM,Position),aCircleM)); // mid point
|
||||||
|
aPrims->AddVertex(Position); // text position
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
|
// texte
|
||||||
|
TCollection_ExtendedString aText (" (+)");
|
||||||
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,Position);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( !AttachPoint.IsEqual(MidPoint, Precision::Confusion()) )
|
||||||
|
{
|
||||||
|
// segment from mid point to the geometry
|
||||||
|
aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(ElCLib::Value(ElCLib::Parameter(aCircleM,AttachPoint),aCircleM)); // mid point
|
||||||
|
aPrims->AddVertex(AttachPoint); // attach point to the geometry
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_OffsetPresentation.ixx>
|
#include <DsgPrs_OffsetPresentation.ixx>
|
||||||
|
|
||||||
#include <gp_Lin.hxx>
|
#include <gp_Lin.hxx>
|
||||||
@ -29,7 +28,7 @@
|
|||||||
#include <gce_MakeLin.hxx>
|
#include <gce_MakeLin.hxx>
|
||||||
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
|
||||||
#include <Prs3d_Arrow.hxx>
|
#include <Prs3d_Arrow.hxx>
|
||||||
#include <Prs3d_ArrowAspect.hxx>
|
#include <Prs3d_ArrowAspect.hxx>
|
||||||
@ -59,11 +58,11 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
const gp_Pnt& AttachmentPoint2,
|
const gp_Pnt& AttachmentPoint2,
|
||||||
const gp_Dir& aDirection,
|
const gp_Dir& aDirection,
|
||||||
const gp_Dir& aDirection2,
|
const gp_Dir& aDirection2,
|
||||||
const gp_Pnt& OffsetPoint) {
|
const gp_Pnt& OffsetPoint)
|
||||||
|
{
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
gp_Lin L1 (AttachmentPoint1,aDirection);
|
gp_Lin L1 (AttachmentPoint1,aDirection);
|
||||||
gp_Lin L2 (AttachmentPoint2,aDirection2);
|
gp_Lin L2 (AttachmentPoint2,aDirection2);
|
||||||
gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1);
|
gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1);
|
||||||
@ -104,55 +103,34 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
||||||
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
|
|
||||||
Quantity_Length X,Y,Z;
|
|
||||||
|
|
||||||
PointMin.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
PointMax.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
// trait de cote : 1er groupe
|
// trait de cote : 1er groupe
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
|
||||||
|
aPrims->AddVertex(PointMin);
|
||||||
|
aPrims->AddVertex(PointMax);
|
||||||
|
|
||||||
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
if (DimNulle) {
|
if (DimNulle)
|
||||||
|
{
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Arrow::Draw(aPresentation,offp,L4.Direction(),LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Arrow::Draw(aPresentation,offp,L4.Direction().Reversed(),LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
|
||||||
Prs3d_Arrow::Draw(aPresentation,offp,L4.Direction(),
|
}
|
||||||
LA->Arrow1Aspect()->Angle(),
|
else
|
||||||
LA->Arrow1Aspect()->Length());
|
{
|
||||||
|
if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length()))
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Arrow::Draw(aPresentation,offp,L4.Direction().Reversed(),
|
|
||||||
LA->Arrow1Aspect()->Angle(),
|
|
||||||
LA->Arrow1Aspect()->Length());
|
|
||||||
} else {
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
|
|
||||||
if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) {
|
|
||||||
outside = Standard_True;
|
outside = Standard_True;
|
||||||
}
|
|
||||||
gp_Dir arrdir = L3.Direction().Reversed();
|
gp_Dir arrdir = L3.Direction().Reversed();
|
||||||
|
if (outside)
|
||||||
if (outside) {
|
|
||||||
arrdir.Reverse();
|
arrdir.Reverse();
|
||||||
}
|
|
||||||
// fleche 1 : 2eme groupe
|
|
||||||
Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir,
|
|
||||||
LA->Arrow1Aspect()->Angle(),
|
|
||||||
LA->Arrow1Aspect()->Length());
|
|
||||||
|
|
||||||
|
// fleche 1 : 2eme groupe
|
||||||
|
Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
// ball 1 : 3eme groupe
|
// ball 1 : 3eme groupe
|
||||||
|
|
||||||
Handle(Graphic3d_AspectMarker3d) MarkerAsp = new Graphic3d_AspectMarker3d();
|
Handle(Graphic3d_AspectMarker3d) MarkerAsp = new Graphic3d_AspectMarker3d();
|
||||||
MarkerAsp->SetType(Aspect_TOM_BALL);
|
MarkerAsp->SetType(Aspect_TOM_BALL);
|
||||||
MarkerAsp->SetScale(0.8);
|
MarkerAsp->SetScale(0.8);
|
||||||
@ -171,26 +149,18 @@ void DsgPrs_OffsetPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
|
||||||
}
|
}
|
||||||
|
|
||||||
AttachmentPoint1.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
Proj1.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
// trait de rappel 1 : 5eme groupe
|
// trait de rappel 1 : 5eme groupe
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
|
aPrims->AddVertex(Proj1);
|
||||||
|
|
||||||
AttachmentPoint2.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
Proj2.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
// trait de rappel 2 : 6eme groupe
|
// trait de rappel 2 : 6eme groupe
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
|
aPrims->AddVertex(Proj2);
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DsgPrs_OffsetPresentation::AddAxes (const Handle(Prs3d_Presentation)& aPresentation,
|
void DsgPrs_OffsetPresentation::AddAxes (const Handle(Prs3d_Presentation)& aPresentation,
|
||||||
@ -200,10 +170,8 @@ void DsgPrs_OffsetPresentation::AddAxes (const Handle(Prs3d_Presentation)& aPres
|
|||||||
const gp_Pnt& AttachmentPoint2,
|
const gp_Pnt& AttachmentPoint2,
|
||||||
const gp_Dir& aDirection,
|
const gp_Dir& aDirection,
|
||||||
const gp_Dir& aDirection2,
|
const gp_Dir& aDirection2,
|
||||||
const gp_Pnt& OffsetPoint) {
|
const gp_Pnt& OffsetPoint)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
gp_Lin L1 (AttachmentPoint1,aDirection);
|
gp_Lin L1 (AttachmentPoint1,aDirection);
|
||||||
gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1);
|
gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L1,OffsetPoint),L1);
|
||||||
|
|
||||||
@ -221,33 +189,26 @@ void DsgPrs_OffsetPresentation::AddAxes (const Handle(Prs3d_Presentation)& aPres
|
|||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(AxeAsp);
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(AxeAsp);
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
Quantity_Length X,Y,Z;
|
|
||||||
|
|
||||||
AttachmentPoint1.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
Proj1.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
// trait d'axe : 1er groupe
|
// trait d'axe : 1er groupe
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
|
aPrims->AddVertex(Proj1);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
|
||||||
Handle(Graphic3d_AspectLine3d) Axe2Asp = new Graphic3d_AspectLine3d (acolor, atype, awidth);
|
Handle(Graphic3d_AspectLine3d) Axe2Asp = new Graphic3d_AspectLine3d (acolor, atype, awidth);
|
||||||
Axe2Asp->SetType ( Aspect_TOL_DOTDASH);
|
Axe2Asp->SetType ( Aspect_TOL_DOTDASH);
|
||||||
Axe2Asp->SetWidth ( 4.);
|
Axe2Asp->SetWidth ( 4.);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(Axe2Asp);
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(Axe2Asp);
|
||||||
|
|
||||||
AttachmentPoint2.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
Proj2.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
// trait d'axe: 2eme groupe
|
// trait d'axe: 2eme groupe
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
|
aPrims->AddVertex(Proj2);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// anneau : 3eme et 4eme groupes
|
// anneau : 3eme et 4eme groupes
|
||||||
|
|
||||||
Graphic3d_Vertex V3d(Proj2.X() ,Proj2.Y(), Proj2.Z());
|
Graphic3d_Vertex V3d(Proj2.X() ,Proj2.Y(), Proj2.Z());
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
@ -267,5 +228,4 @@ void DsgPrs_OffsetPresentation::AddAxes (const Handle(Prs3d_Presentation)& aPres
|
|||||||
Marker2Asp->SetColor(acolor);
|
Marker2Asp->SetColor(acolor);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(Marker2Asp);
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(Marker2Asp);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
|
Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -18,15 +18,13 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_ParalPresentation.ixx>
|
#include <DsgPrs_ParalPresentation.ixx>
|
||||||
#include <gp_Lin.hxx>
|
#include <gp_Lin.hxx>
|
||||||
#include <gp_Dir.hxx>
|
#include <gp_Dir.hxx>
|
||||||
#include <ElCLib.hxx>
|
#include <ElCLib.hxx>
|
||||||
#include <gce_MakeLin.hxx>
|
#include <gce_MakeLin.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
#include <Prs3d_Arrow.hxx>
|
#include <Prs3d_Arrow.hxx>
|
||||||
#include <Prs3d_ArrowAspect.hxx>
|
#include <Prs3d_ArrowAspect.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
@ -42,9 +40,8 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
const gp_Pnt& AttachmentPoint1,
|
const gp_Pnt& AttachmentPoint1,
|
||||||
const gp_Pnt& AttachmentPoint2,
|
const gp_Pnt& AttachmentPoint2,
|
||||||
const gp_Dir& aDirection,
|
const gp_Dir& aDirection,
|
||||||
const gp_Pnt& OffsetPoint) {
|
const gp_Pnt& OffsetPoint)
|
||||||
|
{
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
gp_Lin L1 (AttachmentPoint1,aDirection);
|
gp_Lin L1 (AttachmentPoint1,aDirection);
|
||||||
@ -75,67 +72,45 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
||||||
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
|
|
||||||
Quantity_Length X,Y,Z;
|
|
||||||
|
|
||||||
PointMin.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
PointMax.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
// processing of side : 1st group
|
// processing of side : 1st group
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
|
||||||
|
aPrims->AddVertex(PointMin);
|
||||||
|
aPrims->AddVertex(PointMax);
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) {
|
if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length()))
|
||||||
outside = Standard_True;
|
outside = Standard_True;
|
||||||
}
|
|
||||||
gp_Dir arrdir = L3.Direction().Reversed();
|
gp_Dir arrdir = L3.Direction().Reversed();
|
||||||
|
if (outside)
|
||||||
if (outside) {
|
|
||||||
arrdir.Reverse();
|
arrdir.Reverse();
|
||||||
}
|
|
||||||
// arrow 1 : 2nd group
|
// arrow 1 : 2nd group
|
||||||
Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir,
|
Prs3d_Arrow::Draw(aPresentation,Proj1,arrdir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
|
||||||
LA->Arrow1Aspect()->Angle(),
|
|
||||||
LA->Arrow1Aspect()->Length());
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
// arrow 2 : 3rd group
|
// arrow 2 : 3rd group
|
||||||
Prs3d_Arrow::Draw(aPresentation,Proj2,arrdir.Reversed(),
|
Prs3d_Arrow::Draw(aPresentation,Proj2,arrdir.Reversed(),LA->Arrow2Aspect()->Angle(),LA->Arrow2Aspect()->Length());
|
||||||
LA->Arrow2Aspect()->Angle(),
|
|
||||||
LA->Arrow2Aspect()->Length());
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
|
||||||
// text : 4th group
|
// text : 4th group
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
|
||||||
|
|
||||||
AttachmentPoint1.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
Proj1.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
// processing of call 1 : 5th group
|
// processing of call 1 : 5th group
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
|
aPrims->AddVertex(Proj1);
|
||||||
|
|
||||||
AttachmentPoint2.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
Proj2.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
// processing of call 2 : 6th group
|
// processing of call 2 : 6th group
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
|
aPrims->AddVertex(Proj2);
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -150,9 +125,8 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
const gp_Pnt& AttachmentPoint2,
|
const gp_Pnt& AttachmentPoint2,
|
||||||
const gp_Dir& aDirection,
|
const gp_Dir& aDirection,
|
||||||
const gp_Pnt& OffsetPoint,
|
const gp_Pnt& OffsetPoint,
|
||||||
const DsgPrs_ArrowSide ArrowPrs){
|
const DsgPrs_ArrowSide ArrowPrs)
|
||||||
|
{
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
@ -184,53 +158,30 @@ void DsgPrs_ParalPresentation::Add (const Handle(Prs3d_Presentation)& aPresentat
|
|||||||
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
||||||
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
|
|
||||||
Quantity_Length X,Y,Z;
|
|
||||||
|
|
||||||
PointMin.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
PointMax.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
// processing of face
|
// processing of face
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
|
||||||
|
aPrims->AddVertex(PointMin);
|
||||||
|
aPrims->AddVertex(PointMax);
|
||||||
|
|
||||||
if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) {
|
if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length()))
|
||||||
outside = Standard_True;
|
outside = Standard_True;
|
||||||
}
|
|
||||||
gp_Dir arrdir = L3.Direction().Reversed();
|
gp_Dir arrdir = L3.Direction().Reversed();
|
||||||
|
if (outside)
|
||||||
if (outside) {
|
|
||||||
arrdir.Reverse();
|
arrdir.Reverse();
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AttachmentPoint1.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
Proj1.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
// processing of call 1
|
// processing of call 1
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
|
aPrims->AddVertex(Proj1);
|
||||||
|
|
||||||
AttachmentPoint2.Coord(X,Y,Z);
|
// processing of call 2
|
||||||
V(1).SetCoord(X,Y,Z);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
Proj2.Coord(X,Y,Z);
|
aPrims->AddVertex(Proj2);
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
// processing of call 2
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
// text
|
// text
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,offp);
|
||||||
|
|
||||||
//arrows
|
//arrows
|
||||||
DsgPrs::ComputeSymbol(aPresentation,LA,Proj1,Proj2,arrdir,arrdir.Reversed(),ArrowPrs);
|
DsgPrs::ComputeSymbol(aPresentation,LA,Proj1,Proj2,arrdir,arrdir.Reversed(),ArrowPrs);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,7 +38,8 @@
|
|||||||
#include <Prs3d_LengthAspect.hxx>
|
#include <Prs3d_LengthAspect.hxx>
|
||||||
#include <TCollection_AsciiString.hxx>
|
#include <TCollection_AsciiString.hxx>
|
||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
|
|
||||||
#include <StdPrs_Point.hxx>
|
#include <StdPrs_Point.hxx>
|
||||||
|
|
||||||
@ -56,82 +57,49 @@ void DsgPrs_PerpenPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
LA->LineAspect()->SetTypeOfLine(Aspect_TOL_SOLID); // ou DOT ou DOTDASH
|
LA->LineAspect()->SetTypeOfLine(Aspect_TOL_SOLID); // ou DOT ou DOTDASH
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V1(1,2);
|
// segments
|
||||||
Graphic3d_Array1OfVertex V2(1,2);
|
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines(6,2);
|
||||||
Quantity_Length X1,Y1,Z1;
|
|
||||||
Quantity_Length X2,Y2,Z2;
|
|
||||||
|
|
||||||
// 1er segment
|
aPrims->AddBound(3);
|
||||||
OffsetPoint.Coord(X1,Y1,Z1);
|
aPrims->AddVertex(OffsetPoint);
|
||||||
V1(1).SetCoord(X1,Y1,Z1);
|
aPrims->AddVertex(pAx1);
|
||||||
pAx1.Coord(X2,Y2,Z2);
|
aPrims->AddVertex(pAx2);
|
||||||
V1(2).SetCoord(X2,Y2,Z2); //ou directt dir1.XYZ
|
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V1);
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
|
|
||||||
// 2e segment
|
|
||||||
pAx2.Coord(X2,Y2,Z2);
|
|
||||||
V2(1).SetCoord(X1,Y1,Z1);
|
|
||||||
V2(2).SetCoord(X2,Y2,Z2);
|
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V2);
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
|
|
||||||
// points attache
|
|
||||||
Graphic3d_Array1OfVertex V3(1,2);
|
|
||||||
if (intOut1) {
|
|
||||||
pAx1.Coord(X1,Y1,Z1);
|
|
||||||
V3(1).SetCoord(X1,Y1,Z1);
|
|
||||||
pnt1.Coord(X2,Y2,Z2);
|
|
||||||
V3(2).SetCoord(X2,Y2,Z2);
|
|
||||||
LA->LineAspect()->SetTypeOfLine(Aspect_TOL_DOT); // ou DOT ou DOTDASH
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V3);
|
|
||||||
}
|
|
||||||
if (intOut2) {
|
|
||||||
pAx2.Coord(X1,Y1,Z1);
|
|
||||||
V3(1).SetCoord(X1,Y1,Z1);
|
|
||||||
pnt2.Coord(X2,Y2,Z2);
|
|
||||||
V3(2).SetCoord(X2,Y2,Z2);
|
|
||||||
LA->LineAspect()->SetTypeOfLine(Aspect_TOL_DOT); // ou DOT ou DOTDASH
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->
|
|
||||||
SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V3);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Symbol
|
// Symbol
|
||||||
Graphic3d_Array1OfVertex V4(1,3);
|
|
||||||
gp_Vec vec1(gce_MakeDir(OffsetPoint,pAx1));
|
gp_Vec vec1(gce_MakeDir(OffsetPoint,pAx1));
|
||||||
gp_Vec vec2(gce_MakeDir(OffsetPoint,pAx2));
|
gp_Vec vec2(gce_MakeDir(OffsetPoint,pAx2));
|
||||||
Standard_Real dist1(OffsetPoint.Distance(pAx1));
|
vec1 *= .2 * OffsetPoint.Distance(pAx1);
|
||||||
Standard_Real dist2(OffsetPoint.Distance(pAx2));
|
vec2 *= .2 * OffsetPoint.Distance(pAx2);
|
||||||
vec1 *= dist1;
|
|
||||||
vec1 *= .2;
|
|
||||||
vec2 *= dist2;
|
|
||||||
vec2 *= .2;
|
|
||||||
|
|
||||||
gp_Pnt pAx11 = OffsetPoint.Translated(vec1);
|
gp_Pnt pAx11 = OffsetPoint.Translated(vec1);
|
||||||
gp_Pnt pAx22 = OffsetPoint.Translated(vec2);
|
gp_Pnt pAx22 = OffsetPoint.Translated(vec2);
|
||||||
gp_Pnt p_symb = pAx22.Translated(vec1);
|
gp_Pnt p_symb = pAx22.Translated(vec1);
|
||||||
|
|
||||||
pAx11.Coord(X1,Y1,Z1);
|
aPrims->AddBound(3);
|
||||||
V4(1).SetCoord(X1,Y1,Z1);
|
aPrims->AddVertex(pAx11);
|
||||||
p_symb.Coord(X1,Y1,Z1);
|
aPrims->AddVertex(p_symb);
|
||||||
V4(2).SetCoord(X1,Y1,Z1);
|
aPrims->AddVertex(pAx22);
|
||||||
pAx22.Coord(X1,Y1,Z1);
|
|
||||||
V4(3).SetCoord(X1,Y1,Z1);
|
|
||||||
|
|
||||||
LA->LineAspect()->SetTypeOfLine(Aspect_TOL_SOLID);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V4);
|
// points attache
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
if (intOut1 || intOut2)
|
||||||
|
{
|
||||||
|
LA->LineAspect()->SetTypeOfLine(Aspect_TOL_DOT); // ou DOT ou DOTDASH
|
||||||
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
|
if (intOut1) {
|
||||||
|
aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(pAx1);
|
||||||
|
aPrims->AddVertex(pnt1);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
}
|
||||||
|
if (intOut2) {
|
||||||
|
aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(pAx2);
|
||||||
|
aPrims->AddVertex(pnt2);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include <gp_Circ.hxx>
|
#include <gp_Circ.hxx>
|
||||||
#include <ElCLib.hxx>
|
#include <ElCLib.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
#include <Prs3d_Arrow.hxx>
|
#include <Prs3d_Arrow.hxx>
|
||||||
#include <Prs3d_ArrowAspect.hxx>
|
#include <Prs3d_ArrowAspect.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
@ -48,13 +48,12 @@
|
|||||||
|
|
||||||
|
|
||||||
static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar,
|
static Standard_Boolean DsgPrs_InDomain(const Standard_Real fpar,
|
||||||
const Standard_Real lpar,
|
const Standard_Real lpar,
|
||||||
const Standard_Real para)
|
const Standard_Real para)
|
||||||
{
|
{
|
||||||
if (fpar >= 0.) {
|
if (fpar >= 0.)
|
||||||
return ((para >= fpar) && (para <= lpar));
|
return ((para >= fpar) && (para <= lpar));
|
||||||
}
|
if (para >= (fpar+2.*M_PI)) return Standard_True;
|
||||||
if (para >= (fpar+2*M_PI)) return Standard_True;
|
|
||||||
if (para <= lpar) return Standard_True;
|
if (para <= lpar) return Standard_True;
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
@ -76,48 +75,36 @@ void DsgPrs_RadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
{
|
{
|
||||||
Standard_Real fpara = firstparam;
|
Standard_Real fpara = firstparam;
|
||||||
Standard_Real lpara = lastparam;
|
Standard_Real lpara = lastparam;
|
||||||
while (lpara > 2*M_PI) {
|
while (lpara > 2.*M_PI) {
|
||||||
fpara -= 2*M_PI;
|
fpara -= 2.*M_PI;
|
||||||
lpara -= 2*M_PI;
|
lpara -= 2.*M_PI;
|
||||||
}
|
}
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
Standard_Real parat = ElCLib::Parameter(aCircle,AttachmentPoint);
|
Standard_Real parat = ElCLib::Parameter(aCircle,AttachmentPoint);
|
||||||
gp_Pnt attpoint = AttachmentPoint;
|
gp_Pnt attpoint = AttachmentPoint;
|
||||||
Standard_Boolean otherside = Standard_False;
|
Standard_Boolean otherside = Standard_False;
|
||||||
if ( !DsgPrs_InDomain(fpara,lpara,parat)) {
|
if ( !DsgPrs_InDomain(fpara,lpara,parat)) {
|
||||||
Standard_Real otherpar = parat + M_PI;
|
Standard_Real otherpar = parat + M_PI;
|
||||||
if (otherpar > 2*M_PI) otherpar -= 2*M_PI;
|
if (otherpar > 2.*M_PI) otherpar -= 2.*M_PI;
|
||||||
if (DsgPrs_InDomain(fpara,lpara,otherpar)) {
|
if (DsgPrs_InDomain(fpara,lpara,otherpar)) {
|
||||||
parat = otherpar;
|
parat = otherpar;
|
||||||
otherside = Standard_True;
|
otherside = Standard_True;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Standard_Real ecartpar = Min(Abs(fpara-parat),
|
const Standard_Real ecartpar = Min(Abs(fpara-parat),Abs(lpara-parat));
|
||||||
Abs(lpara-parat));
|
const Standard_Real ecartoth = Min(Abs(fpara-otherpar),Abs(lpara-otherpar));
|
||||||
Standard_Real ecartoth = Min(Abs(fpara-otherpar),
|
|
||||||
Abs(lpara-otherpar));
|
|
||||||
if (ecartpar <= ecartoth) {
|
if (ecartpar <= ecartoth) {
|
||||||
if (parat < fpara) {
|
parat = (parat < fpara)? fpara : lpara;
|
||||||
parat = fpara;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
parat = lpara;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
otherside = Standard_True;
|
otherside = Standard_True;
|
||||||
if (otherpar < fpara) {
|
parat = (otherpar < fpara)? fpara : lpara;
|
||||||
parat = fpara;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
parat = lpara;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
gp_Pnt ptdir = ElCLib::Value(parat,aCircle);
|
gp_Pnt ptdir = ElCLib::Value(parat,aCircle);
|
||||||
gp_Lin lsup(aCircle.Location(),
|
gp_Lin lsup(aCircle.Location(),gp_Dir(ptdir.XYZ()-aCircle.Location().XYZ()));
|
||||||
gp_Dir(ptdir.XYZ()-aCircle.Location().XYZ()));
|
const Standard_Real parpos = ElCLib::Parameter(lsup,AttachmentPoint);
|
||||||
Standard_Real parpos = ElCLib::Parameter(lsup,AttachmentPoint);
|
|
||||||
attpoint = ElCLib::Value(parpos,lsup);
|
attpoint = ElCLib::Value(parpos,lsup);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -126,40 +113,28 @@ void DsgPrs_RadiusPresentation::Add (const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
gp_Pnt firstpoint = attpoint;
|
gp_Pnt firstpoint = attpoint;
|
||||||
gp_Pnt drawtopoint = ptoncirc;
|
gp_Pnt drawtopoint = ptoncirc;
|
||||||
if (drawFromCenter && !otherside) {
|
if (drawFromCenter && !otherside) {
|
||||||
Standard_Real uatt = ElCLib::Parameter(L,attpoint);
|
const Standard_Real uatt = ElCLib::Parameter(L,attpoint);
|
||||||
Standard_Real uptc = ElCLib::Parameter(L,ptoncirc);
|
const Standard_Real uptc = ElCLib::Parameter(L,ptoncirc);
|
||||||
if (Abs(uatt) > Abs(uptc)) {
|
if (Abs(uatt) > Abs(uptc))
|
||||||
drawtopoint = aCircle.Location();
|
drawtopoint = aCircle.Location();
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
firstpoint = aCircle.Location();
|
firstpoint = aCircle.Location();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(firstpoint);
|
||||||
Quantity_Length X,Y,Z;
|
aPrims->AddVertex(drawtopoint);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
firstpoint.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
drawtopoint.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
gp_Dir arrdir = L.Direction();
|
gp_Dir arrdir = L.Direction();
|
||||||
if (reverseArrow) {
|
if (reverseArrow)
|
||||||
arrdir.Reverse();
|
arrdir.Reverse();
|
||||||
}
|
|
||||||
// fleche
|
// fleche
|
||||||
Prs3d_Arrow::Draw(aPresentation,ptoncirc,arrdir,
|
Prs3d_Arrow::Draw(aPresentation,ptoncirc,arrdir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
|
||||||
LA->Arrow1Aspect()->Angle(),
|
|
||||||
LA->Arrow1Aspect()->Length());
|
|
||||||
|
|
||||||
// texte
|
// texte
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,attpoint);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,attpoint);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -181,27 +156,19 @@ void DsgPrs_RadiusPresentation::Add( const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
Handle( Prs3d_LengthAspect ) LA = aDrawer->LengthAspect();
|
Handle( Prs3d_LengthAspect ) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
|
Prs3d_Root::CurrentGroup( aPresentation )->SetPrimitivesAspect( LA->LineAspect()->Aspect() );
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex VertexArray( 1, 2 );
|
gp_Pnt LineOrigin, LineEnd;
|
||||||
gp_Pnt LineOrigin, LineEnd;
|
DsgPrs::ComputeRadiusLine(Center, EndOfArrow, AttachmentPoint, drawFromCenter, LineOrigin, LineEnd);
|
||||||
Quantity_Length X,Y,Z;
|
|
||||||
|
|
||||||
DsgPrs::ComputeRadiusLine( Center, EndOfArrow, AttachmentPoint, drawFromCenter,
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
LineOrigin, LineEnd);
|
aPrims->AddVertex(LineOrigin);
|
||||||
//
|
aPrims->AddVertex(LineEnd);
|
||||||
LineOrigin.Coord( X, Y, Z );
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
VertexArray(1).SetCoord( X, Y, Z );
|
|
||||||
|
|
||||||
LineEnd.Coord( X, Y, Z );
|
|
||||||
VertexArray(2).SetCoord( X, Y, Z );
|
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup( aPresentation )->Polyline( VertexArray );
|
|
||||||
// text
|
// text
|
||||||
Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, AttachmentPoint );
|
Prs3d_Text::Draw( aPresentation, LA->TextAspect(), aText, AttachmentPoint );
|
||||||
|
|
||||||
gp_Dir ArrowDir = gce_MakeDir( LineOrigin , LineEnd );
|
gp_Dir ArrowDir = gce_MakeDir( LineOrigin , LineEnd );
|
||||||
if (reverseArrow)
|
if (reverseArrow)
|
||||||
ArrowDir.Reverse();
|
ArrowDir.Reverse();
|
||||||
DsgPrs::ComputeSymbol( aPresentation, LA, Center, EndOfArrow, ArrowDir.Reversed(), ArrowDir,
|
DsgPrs::ComputeSymbol( aPresentation, LA, Center, EndOfArrow, ArrowDir.Reversed(), ArrowDir, ArrowPrs, drawFromCenter );
|
||||||
ArrowPrs, drawFromCenter );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,15 +18,13 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_ShadedPlanePresentation.ixx>
|
#include <DsgPrs_ShadedPlanePresentation.ixx>
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
#include <Prs3d_PlaneAspect.hxx>
|
#include <Prs3d_PlaneAspect.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
#include <Prs3d_ShadingAspect.hxx>
|
#include <Prs3d_ShadingAspect.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfPolygons.hxx>
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -43,18 +41,11 @@ void DsgPrs_ShadedPlanePresentation::Add(const Handle(Prs3d_Presentation)& aPres
|
|||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->PlaneAspect()->EdgesAspect()->Aspect());
|
TheGroup->SetPrimitivesAspect(aDrawer->PlaneAspect()->EdgesAspect()->Aspect());
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->ShadingAspect()->Aspect());
|
TheGroup->SetPrimitivesAspect(aDrawer->ShadingAspect()->Aspect());
|
||||||
Quantity_Length x1,y1,z1,x2,y2,z2,x3,y3,z3;
|
|
||||||
|
|
||||||
aPt1.Coord(x1,y1,z1);
|
Handle(Graphic3d_ArrayOfPolygons) aPrims = new Graphic3d_ArrayOfPolygons(4);
|
||||||
aPt2.Coord(x2,y2,z2);
|
aPrims->AddVertex(aPt1);
|
||||||
aPt3.Coord(x3,y3,z3);
|
aPrims->AddVertex(aPt2);
|
||||||
|
aPrims->AddVertex(aPt3);
|
||||||
Graphic3d_Array1OfVertex A(1,5);
|
aPrims->AddVertex(aPt1);
|
||||||
A(1).SetCoord(x1,y1,z1);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
A(2).SetCoord(x2,y2,z2);
|
|
||||||
A(3).SetCoord(x3,y3,z3);
|
|
||||||
A(4).SetCoord(x1,y1,z1);
|
|
||||||
A(5)=A(1);
|
|
||||||
|
|
||||||
TheGroup->Polygon(A);
|
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_ShapeDirPresentation.ixx>
|
#include <DsgPrs_ShapeDirPresentation.ixx>
|
||||||
|
|
||||||
#include <gp.hxx>
|
#include <gp.hxx>
|
||||||
@ -42,14 +40,12 @@
|
|||||||
#include <TopTools_ListOfShape.hxx>
|
#include <TopTools_ListOfShape.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
#include <BRepTools_WireExplorer.hxx>
|
#include <BRepTools_WireExplorer.hxx>
|
||||||
//#include <BRepAdaptor_Curve2d.hxx>
|
|
||||||
#include <BRepClass_FaceClassifier.hxx>
|
#include <BRepClass_FaceClassifier.hxx>
|
||||||
#include <BRepClass_Edge.hxx>
|
#include <BRepClass_Edge.hxx>
|
||||||
#include <BRepBndLib.hxx>
|
#include <BRepBndLib.hxx>
|
||||||
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Vertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
|
||||||
#include <Prs3d_Arrow.hxx>
|
#include <Prs3d_Arrow.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
|
|
||||||
@ -57,7 +53,6 @@
|
|||||||
#include <TColgp_Array1OfPnt2d.hxx>
|
#include <TColgp_Array1OfPnt2d.hxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : FindPointOnFace
|
//function : FindPointOnFace
|
||||||
//purpose : internal use
|
//purpose : internal use
|
||||||
@ -157,15 +152,9 @@ static Standard_Boolean ComputeDir(const TopoDS_Shape& shape, gp_Pnt& pt, gp_Dir
|
|||||||
Handle(Geom_Curve) curve = Handle(Geom_Curve)::DownCast(curv0->Copy());
|
Handle(Geom_Curve) curve = Handle(Geom_Curve)::DownCast(curv0->Copy());
|
||||||
curve->Transform(loc.Transformation());
|
curve->Transform(loc.Transformation());
|
||||||
GeomLProp_CLProps lProps(curve, 1, gp::Resolution());
|
GeomLProp_CLProps lProps(curve, 1, gp::Resolution());
|
||||||
if (mode == 0) {
|
lProps.SetParameter((mode == 0)? last : first);
|
||||||
lProps.SetParameter(last);
|
if (!lProps.IsTangentDefined())
|
||||||
}
|
|
||||||
else if (mode == 1) {
|
|
||||||
lProps.SetParameter(first);
|
|
||||||
}
|
|
||||||
if (!lProps.IsTangentDefined()) {
|
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
|
||||||
pt = lProps.Value();
|
pt = lProps.Value();
|
||||||
lProps.Tangent(dir);
|
lProps.Tangent(dir);
|
||||||
}
|
}
|
||||||
@ -178,16 +167,13 @@ static Standard_Boolean ComputeDir(const TopoDS_Shape& shape, gp_Pnt& pt, gp_Dir
|
|||||||
pt2d.SetCoord((u1+u2)*0.5, (v1+v2)*0.5);
|
pt2d.SetCoord((u1+u2)*0.5, (v1+v2)*0.5);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Standard_Boolean found = FindPointOnFace(TopoDS::Face(shape), pt2d);
|
if (!FindPointOnFace(TopoDS::Face(shape), pt2d))
|
||||||
if (!found) {
|
return Standard_False;
|
||||||
return Standard_False;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GeomLProp_SLProps lProps(surface, pt2d.X(), pt2d.Y(), 1, gp::Resolution());
|
GeomLProp_SLProps lProps(surface, pt2d.X(), pt2d.Y(), 1, gp::Resolution());
|
||||||
if (!lProps.IsNormalDefined()) {
|
if (!lProps.IsNormalDefined())
|
||||||
return Standard_False;
|
return Standard_False;
|
||||||
}
|
|
||||||
|
|
||||||
pt = lProps.Value();
|
pt = lProps.Value();
|
||||||
dir = lProps.Normal();
|
dir = lProps.Normal();
|
||||||
@ -211,9 +197,8 @@ void DsgPrs_ShapeDirPresentation::Add(const Handle(Prs3d_Presentation)& prs,
|
|||||||
const Standard_Integer mode)
|
const Standard_Integer mode)
|
||||||
|
|
||||||
{
|
{
|
||||||
if ((mode != 0) && (mode != 1)) {
|
if ((mode != 0) && (mode != 1))
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
gp_Dir dir;
|
gp_Dir dir;
|
||||||
gp_Pnt pt;
|
gp_Pnt pt;
|
||||||
@ -234,9 +219,8 @@ void DsgPrs_ShapeDirPresentation::Add(const Handle(Prs3d_Presentation)& prs,
|
|||||||
for (anExp.Init(TopoDS::Wire(shape)); anExp.More(); anExp.Next()) {
|
for (anExp.Init(TopoDS::Wire(shape)); anExp.More(); anExp.Next()) {
|
||||||
const TopoDS_Edge& edge = anExp.Current();
|
const TopoDS_Edge& edge = anExp.Current();
|
||||||
nb++;
|
nb++;
|
||||||
if (nb <=3) {
|
if (nb <=3)
|
||||||
BRepBndLib::Add(edge, box);
|
BRepBndLib::Add(edge, box);
|
||||||
}
|
|
||||||
aList.Append(edge);
|
aList.Append(edge);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,15 +257,14 @@ void DsgPrs_ShapeDirPresentation::Add(const Handle(Prs3d_Presentation)& prs,
|
|||||||
// mei 19/09/96 extrusion infinie -> taille fixe
|
// mei 19/09/96 extrusion infinie -> taille fixe
|
||||||
if (leng >= 20000.) leng = 50;
|
if (leng >= 20000.) leng = 50;
|
||||||
|
|
||||||
gp_Pnt pt2(pt.X()+leng*dir.X(), pt.Y()+leng*dir.Y(), pt.Z()+leng*dir.Z());
|
gp_Pnt pt2(pt.XYZ()+leng*dir.XYZ());
|
||||||
Graphic3d_Array1OfVertex line(1,2);
|
|
||||||
line(1).SetCoord(pt.X(), pt.Y(), pt.Z());
|
|
||||||
line(2).SetCoord(pt2.X(), pt2.Y(), pt2.Z());
|
|
||||||
|
|
||||||
Prs3d_Root::CurrentGroup(prs)->SetPrimitivesAspect(drawer->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(prs)->SetPrimitivesAspect(drawer->LineAspect()->Aspect());
|
||||||
Prs3d_Root::CurrentGroup(prs)->Polyline(line);
|
|
||||||
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(pt);
|
||||||
|
aPrims->AddVertex(pt2);
|
||||||
|
Prs3d_Root::CurrentGroup(prs)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
Prs3d_Arrow::Draw(prs, pt2, dir, M_PI/180.*10., leng*0.3);
|
Prs3d_Arrow::Draw(prs, pt2, dir, M_PI/180.*10., leng*0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_SymmetricPresentation.ixx>
|
#include <DsgPrs_SymmetricPresentation.ixx>
|
||||||
|
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
@ -42,7 +40,8 @@
|
|||||||
#include <gce_MakeDir.hxx>
|
#include <gce_MakeDir.hxx>
|
||||||
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
#include <Graphic3d_AspectMarker3d.hxx>
|
#include <Graphic3d_AspectMarker3d.hxx>
|
||||||
#include <Graphic3d_Vertex.hxx>
|
#include <Graphic3d_Vertex.hxx>
|
||||||
@ -75,10 +74,10 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
{
|
{
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
gp_Pnt ProjOffsetPoint = ElCLib::Value(ElCLib::Parameter(aAxis,OffsetPoint),aAxis);
|
gp_Pnt ProjOffsetPoint = ElCLib::Value(ElCLib::Parameter(aAxis,OffsetPoint),aAxis);
|
||||||
gp_Pnt PjAttachPnt1 = ElCLib::Value(ElCLib::Parameter(aAxis,AttachmentPoint1),aAxis);
|
gp_Pnt PjAttachPnt1 = ElCLib::Value(ElCLib::Parameter(aAxis,AttachmentPoint1),aAxis);
|
||||||
gp_Dir aDirectionAxis = aAxis.Direction();
|
gp_Dir aDirectionAxis = aAxis.Direction();
|
||||||
// gp_Lin L1 (AttachmentPoint1,aDirection1);
|
|
||||||
Standard_Real h = fabs(ProjOffsetPoint.Distance(PjAttachPnt1)/cos(aDirectionAxis.Angle(aDirection1)));
|
Standard_Real h = fabs(ProjOffsetPoint.Distance(PjAttachPnt1)/cos(aDirectionAxis.Angle(aDirection1)));
|
||||||
|
|
||||||
gp_Vec VL1(aDirection1);
|
gp_Vec VL1(aDirection1);
|
||||||
@ -132,19 +131,12 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
|
|
||||||
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
||||||
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
Graphic3d_Array1OfVertex Vc(1,3);
|
|
||||||
Quantity_Length X,Y,Z;
|
Quantity_Length X,Y,Z;
|
||||||
Standard_Real D1,coeff;
|
Standard_Real D1(aAxis.Distance(AttachmentPoint1)),coeff(.5);
|
||||||
coeff = .5;
|
gp_Pnt pint,Pj_P1,P1Previous = P1;
|
||||||
D1 = aAxis.Distance(AttachmentPoint1);
|
|
||||||
gp_Pnt pint,Pj_P1,P1Previous;
|
|
||||||
P1Previous.SetX(P1.X());
|
|
||||||
P1Previous.SetY(P1.Y());
|
|
||||||
P1Previous.SetZ(P1.Z());
|
|
||||||
|
|
||||||
|
//=======================================================
|
||||||
/*//=======================================================
|
|
||||||
// TO AVOID CROSSING
|
// TO AVOID CROSSING
|
||||||
// P1 -=- P2 P2 -=- P1
|
// P1 -=- P2 P2 -=- P1
|
||||||
// \<-->/ |<-->|
|
// \<-->/ |<-->|
|
||||||
@ -155,7 +147,6 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
// Pattach2 /____\ Pattach1 Pattach2 /______\ Pattach1
|
// Pattach2 /____\ Pattach1 Pattach2 /______\ Pattach1
|
||||||
// / NO \ / YES \
|
// / NO \ / YES \
|
||||||
//=======================================================
|
//=======================================================
|
||||||
*/
|
|
||||||
|
|
||||||
Standard_Boolean Cross = Standard_False;
|
Standard_Boolean Cross = Standard_False;
|
||||||
gp_Vec Attch1_PjAttch1(AttachmentPoint1,PjAttachPnt1);
|
gp_Vec Attch1_PjAttch1(AttachmentPoint1,PjAttachPnt1);
|
||||||
@ -167,16 +158,15 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
P1 = P2;
|
P1 = P2;
|
||||||
P2 = PntTempo;
|
P2 = PntTempo;
|
||||||
}
|
}
|
||||||
/* //===================================
|
//===================================
|
||||||
// FRACTURES OF TRAITS OF CALL
|
// FRACTURES OF TRAITS OF CALL
|
||||||
// / \
|
// / \
|
||||||
// / \
|
// / \
|
||||||
// | -=- |
|
// | -=- |
|
||||||
// |<------------->|
|
// |<------------->|
|
||||||
//===================================
|
//===================================
|
||||||
*/
|
|
||||||
gp_Vec Vfix;
|
gp_Vec Vfix;
|
||||||
// Standard_Real alpha,b,s,d;
|
|
||||||
Standard_Real alpha,b;
|
Standard_Real alpha,b;
|
||||||
|
|
||||||
if(aAxis.Distance(P1) > D1*(1 + coeff) && !Cross){
|
if(aAxis.Distance(P1) > D1*(1 + coeff) && !Cross){
|
||||||
@ -184,13 +174,12 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
//==== PROCESSING OF FACE ===========
|
//==== PROCESSING OF FACE ===========
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
Pj_P1 = ElCLib::Value(ElCLib::Parameter(aAxis,P1),aAxis);
|
Pj_P1 = ElCLib::Value(ElCLib::Parameter(aAxis,P1),aAxis);
|
||||||
gp_Vec Vp(Pj_P1,P1);
|
gp_Vec Vp(Pj_P1,P1);
|
||||||
Vfix = Vp.Divided(Vp.Magnitude()).Multiplied(D1*(1 + coeff));
|
Vfix = Vp.Divided(Vp.Magnitude()).Multiplied(D1*(1 + coeff));
|
||||||
Pj_P1.Translated(Vfix).Coord(X,Y,Z);
|
P1 = Pj_P1.Translated(Vfix);
|
||||||
P1.SetCoord(X,Y,Z);
|
P2 = Pj_P1.Translated(Vfix.Reversed());
|
||||||
Pj_P1.Translated(Vfix.Reversed()).Coord(X,Y,Z);
|
|
||||||
P2.SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
//=================================
|
//=================================
|
||||||
// LISTING AT THE EXTERIOR
|
// LISTING AT THE EXTERIOR
|
||||||
@ -220,49 +209,37 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
PointMin = ElCLib::Value(parmin,L3);
|
PointMin = ElCLib::Value(parmin,L3);
|
||||||
PointMax = ElCLib::Value(parmax,L3);
|
PointMax = ElCLib::Value(parmax,L3);
|
||||||
|
|
||||||
PointMin.Coord(X,Y,Z);
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(8,3);
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
PointMax.Coord(X,Y,Z);
|
aPrims->AddBound(2);
|
||||||
V(2).SetCoord(X,Y,Z);
|
aPrims->AddVertex(PointMin);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(PointMax);
|
||||||
|
|
||||||
//==== PROCESSING OF CALL 1 =====
|
//==== PROCESSING OF CALL 1 =====
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
AttachmentPoint1.Coord(X,Y,Z);
|
|
||||||
Vc(1).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
alpha = aDirectionAxis.Angle(aDirection1);
|
alpha = aDirectionAxis.Angle(aDirection1);
|
||||||
b = (coeff*D1)/sin(alpha);
|
b = (coeff*D1)/sin(alpha);
|
||||||
gp_Vec Vpint(AttachmentPoint1,P1Previous);
|
gp_Vec Vpint(AttachmentPoint1,P1Previous);
|
||||||
AttachmentPoint1.Translated(Vpint.Divided(Vpint.Magnitude()).Multiplied(b)).Coord(X,Y,Z);
|
pint = AttachmentPoint1.Translated(Vpint.Divided(Vpint.Magnitude()).Multiplied(b));
|
||||||
pint.SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
pint.Coord(X,Y,Z);
|
aPrims->AddBound(3);
|
||||||
Vc(2).SetCoord(X,Y,Z);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
P1.Coord(X,Y,Z);
|
aPrims->AddVertex(pint);
|
||||||
Vc(3).SetCoord(X,Y,Z);
|
aPrims->AddVertex(P1);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vc);
|
|
||||||
|
|
||||||
//==== PROCESSING OF CALL 2 =====
|
//==== PROCESSING OF CALL 2 =====
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
AttachmentPoint2.Coord(X,Y,Z);
|
|
||||||
Vc(1).SetCoord(X,Y,Z);
|
|
||||||
gp_Pnt Pj_pint = ElCLib::Value(ElCLib::Parameter(aAxis,pint),aAxis);
|
gp_Pnt Pj_pint = ElCLib::Value(ElCLib::Parameter(aAxis,pint),aAxis);
|
||||||
gp_Vec V_int(pint, Pj_pint);
|
gp_Vec V_int(pint, Pj_pint);
|
||||||
gp_Pnt Sym_pint;
|
gp_Pnt Sym_pint = Pj_pint.Translated(V_int);
|
||||||
Pj_pint.Translated(V_int).Coord(X,Y,Z);
|
|
||||||
Sym_pint.SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
Sym_pint.Coord(X,Y,Z);
|
aPrims->AddBound(3);
|
||||||
Vc(2).SetCoord(X,Y,Z);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
P2.Coord(X,Y,Z);
|
aPrims->AddVertex(Sym_pint);
|
||||||
Vc(3).SetCoord(X,Y,Z);
|
aPrims->AddVertex(P2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vc);
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*//===================================
|
//===================================
|
||||||
// FRACTURES OF PROCESSING OF CALL
|
// FRACTURES OF PROCESSING OF CALL
|
||||||
// -=-
|
// -=-
|
||||||
// |<--------->|
|
// |<--------->|
|
||||||
@ -270,12 +247,12 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
// / \
|
// / \
|
||||||
// / \
|
// / \
|
||||||
//===================================
|
//===================================
|
||||||
*/
|
|
||||||
else if (aAxis.Distance(P1) < D1*(1 - coeff) || Cross) {
|
else if (aAxis.Distance(P1) < D1*(1 - coeff) || Cross) {
|
||||||
|
|
||||||
//------ PROCESSING OF FACE ------------
|
//------ PROCESSING OF FACE ------------
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
Pj_P1 = ElCLib::Value(ElCLib::Parameter(aAxis,P1),aAxis);
|
Pj_P1 = ElCLib::Value(ElCLib::Parameter(aAxis,P1),aAxis);
|
||||||
gp_Vec VpInf(Pj_P1,P1);
|
gp_Vec VpInf(Pj_P1,P1);
|
||||||
Vfix = VpInf.Divided(VpInf.Magnitude()).Multiplied(D1*(1 - coeff));
|
Vfix = VpInf.Divided(VpInf.Magnitude()).Multiplied(D1*(1 - coeff));
|
||||||
@ -311,75 +288,55 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
PointMin = ElCLib::Value(parmin,L3);
|
PointMin = ElCLib::Value(parmin,L3);
|
||||||
PointMax = ElCLib::Value(parmax,L3);
|
PointMax = ElCLib::Value(parmax,L3);
|
||||||
|
|
||||||
PointMin.Coord(X,Y,Z);
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(8,3);
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
PointMax.Coord(X,Y,Z);
|
aPrims->AddBound(2);
|
||||||
V(2).SetCoord(X,Y,Z);
|
aPrims->AddVertex(PointMin);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(PointMax);
|
||||||
|
|
||||||
//==== PROCESSING OF CALL 1 =====
|
//==== PROCESSING OF CALL 1 =====
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
AttachmentPoint1.Coord(X,Y,Z);
|
|
||||||
Vc(1).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
alpha = aDirectionAxis.Angle(aDirection1);
|
alpha = aDirectionAxis.Angle(aDirection1);
|
||||||
b = (coeff*D1)/sin(alpha);
|
b = (coeff*D1)/sin(alpha);
|
||||||
gp_Vec Vpint(AttachmentPoint1,P1Previous);
|
gp_Vec Vpint(AttachmentPoint1,P1Previous);
|
||||||
AttachmentPoint1.Translated(Vpint.Divided(Vpint.Magnitude()).Multiplied(b)).Coord(X,Y,Z);
|
pint = AttachmentPoint1.Translated(Vpint.Divided(Vpint.Magnitude()).Multiplied(b));
|
||||||
pint.SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
pint.Coord(X,Y,Z);
|
aPrims->AddBound(3);
|
||||||
Vc(2).SetCoord(X,Y,Z);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
P1.Coord(X,Y,Z);
|
aPrims->AddVertex(pint);
|
||||||
Vc(3).SetCoord(X,Y,Z);
|
aPrims->AddVertex(P1);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vc);
|
|
||||||
|
|
||||||
//==== PROCESSING OF CALL 2 =====
|
//==== PROCESSING OF CALL 2 =====
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
AttachmentPoint2.Coord(X,Y,Z);
|
|
||||||
Vc(1).SetCoord(X,Y,Z);
|
|
||||||
gp_Pnt Pj_pint = ElCLib::Value(ElCLib::Parameter(aAxis,pint),aAxis);
|
gp_Pnt Pj_pint = ElCLib::Value(ElCLib::Parameter(aAxis,pint),aAxis);
|
||||||
gp_Vec V_int(pint, Pj_pint);
|
gp_Vec V_int(pint, Pj_pint);
|
||||||
gp_Pnt Sym_pint;
|
gp_Pnt Sym_pint = Pj_pint.Translated(V_int);
|
||||||
Pj_pint.Translated(V_int).Coord(X,Y,Z);
|
|
||||||
Sym_pint.SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
Sym_pint.Coord(X,Y,Z);
|
aPrims->AddBound(3);
|
||||||
Vc(2).SetCoord(X,Y,Z);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
P2.Coord(X,Y,Z);
|
aPrims->AddVertex(Sym_pint);
|
||||||
Vc(3).SetCoord(X,Y,Z);
|
aPrims->AddVertex(P2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vc);
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
//==== PROCESSING OF FACE ===========
|
//==== PROCESSING OF FACE ===========
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
PointMin.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(6);
|
||||||
PointMax.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
aPrims->AddVertex(PointMin);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(PointMax);
|
||||||
|
|
||||||
//==== PROCESSING OF CALL 1 =====
|
//==== PROCESSING OF CALL 1 =====
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
aPrims->AddVertex(P1);
|
||||||
AttachmentPoint1.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
P1.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
//==== PROCESSING OF CALL 2 =====
|
//==== PROCESSING OF CALL 2 =====
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
aPrims->AddVertex(P2);
|
||||||
AttachmentPoint2.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
P2.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//==== ARROWS ================
|
//==== ARROWS ================
|
||||||
@ -390,14 +347,10 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
gp_Dir arrdir = L3.Direction().Reversed();
|
gp_Dir arrdir = L3.Direction().Reversed();
|
||||||
if (outside) arrdir.Reverse();
|
if (outside) arrdir.Reverse();
|
||||||
// arrow 1 ----
|
// arrow 1 ----
|
||||||
Prs3d_Arrow::Draw(aPresentation,P1,arrdir,
|
Prs3d_Arrow::Draw(aPresentation,P1,arrdir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
|
||||||
LA->Arrow1Aspect()->Angle(),
|
|
||||||
LA->Arrow1Aspect()->Length());
|
|
||||||
|
|
||||||
// arrow 2 ----
|
// arrow 2 ----
|
||||||
Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),
|
Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),LA->Arrow2Aspect()->Angle(),LA->Arrow2Aspect()->Length());
|
||||||
LA->Arrow2Aspect()->Angle(),
|
|
||||||
LA->Arrow2Aspect()->Length());
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
//| SYMBOL OF SYMMETRY |
|
//| SYMBOL OF SYMMETRY |
|
||||||
@ -427,42 +380,35 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
else {
|
else {
|
||||||
pm = P1.Translated(Vvar.Multiplied(.5));
|
pm = P1.Translated(Vvar.Multiplied(.5));
|
||||||
}
|
}
|
||||||
//pm = P1.Translated(Vvar.Multiplied(.5));
|
|
||||||
pOff = OffsetPoint.Translated(vecB);
|
pOff = OffsetPoint.Translated(vecB);
|
||||||
|
|
||||||
//Calculate the extremities of the symbol axis
|
//Calculate the extremities of the symbol axis
|
||||||
gp_Vec vecAxe = vecA.Multiplied(.7);
|
gp_Vec vecAxe = vecA.Multiplied(.7);
|
||||||
pOff.Translated(vecAxe).Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
pOff.Translated(vecAxe.Reversed()).Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(13,5);
|
||||||
|
|
||||||
|
aPrims->AddBound(2);
|
||||||
|
aPrims->AddVertex(pOff.Translated(vecAxe));
|
||||||
|
aPrims->AddVertex(pOff.Translated(vecAxe.Reversed()));
|
||||||
|
|
||||||
//Calculate the extremities of the superior segment of the symbol
|
//Calculate the extremities of the superior segment of the symbol
|
||||||
gp_Vec vec1 = vecAxe.Multiplied(.6);
|
gp_Vec vec1 = vecAxe.Multiplied(.6);
|
||||||
vecAxe = Vaxe.Multiplied(vecAxe.Magnitude());
|
vecAxe = Vaxe.Multiplied(vecAxe.Magnitude());
|
||||||
gp_Vec vec2 = vecAxe.Multiplied(.4);
|
gp_Vec vec2 = vecAxe.Multiplied(.4);
|
||||||
|
|
||||||
pOff.Translated(vec1.Added(vec2)).Coord(X,Y,Z);
|
aPrims->AddBound(2);
|
||||||
V(1).SetCoord(X,Y,Z);
|
aPrims->AddVertex(pOff.Translated(vec1.Added(vec2)));
|
||||||
pOff.Translated(vec1.Reversed().Added(vec2)).Coord(X,Y,Z);
|
aPrims->AddVertex(pOff.Translated(vec1.Reversed().Added(vec2)));
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
//Calculate the extremities of the inferior segment of the symbol
|
//Calculate the extremities of the inferior segment of the symbol
|
||||||
pOff.Translated(vec1.Added(vec2.Reversed())).Coord(X,Y,Z);
|
aPrims->AddBound(2);
|
||||||
V(1).SetCoord(X,Y,Z);
|
aPrims->AddVertex(pOff.Translated(vec1.Added(vec2.Reversed())));
|
||||||
pOff.Translated(vec1.Reversed().Added(vec2.Reversed())).Coord(X,Y,Z);
|
aPrims->AddVertex(pOff.Translated(vec1.Reversed().Added(vec2.Reversed())));
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
/*//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
//| MARKING OF THE SYMMETRY AXIS |
|
//| MARKING OF THE SYMMETRY AXIS |
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
// ____
|
// ____
|
||||||
@ -470,42 +416,31 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
// \/
|
// \/
|
||||||
// /\
|
// /\
|
||||||
// /__\
|
// /__\
|
||||||
*/
|
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex cursor(1,5);
|
Standard_Real Dist = (aAxis.Distance(AttachmentPoint1)+aAxis.Distance(AttachmentPoint2))/75;
|
||||||
Standard_Real Dist = (aAxis.Distance(AttachmentPoint1)+
|
|
||||||
aAxis.Distance(AttachmentPoint2))/75;
|
|
||||||
gp_Vec vs(aDirectionAxis);
|
gp_Vec vs(aDirectionAxis);
|
||||||
gp_Vec vsym(vs.Divided(vs.Magnitude()).Multiplied(Dist).XYZ());
|
gp_Vec vsym(vs.Divided(vs.Magnitude()).Multiplied(Dist).XYZ());
|
||||||
|
|
||||||
gp_Vec vsymper(vsym.Y(),-vsym.X(),vsym.Z());
|
gp_Vec vsymper(vsym.Y(),-vsym.X(),vsym.Z());
|
||||||
|
|
||||||
|
aPrims->AddBound(5);
|
||||||
gp_Pnt pm1 = pm.Translated(vsym.Added(vsymper));
|
gp_Pnt pm1 = pm.Translated(vsym.Added(vsymper));
|
||||||
cursor(1).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
aPrims->AddVertex(pm1);
|
||||||
pm1 = pm1.Translated(vsym.Reversed().Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
|
pm1 = pm1.Translated(vsym.Reversed().Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
|
||||||
cursor(2).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
aPrims->AddVertex(pm1);
|
||||||
pm1 = pm1.Translated(vsymper.Multiplied(2));
|
pm1 = pm1.Translated(vsymper.Multiplied(2));
|
||||||
cursor(3).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
aPrims->AddVertex(pm1);
|
||||||
pm1 = pm1.Translated(vsym.Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
|
pm1 = pm1.Translated(vsym.Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
|
||||||
cursor(4).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
aPrims->AddVertex(pm1);
|
||||||
pm1 = pm1.Translated(vsymper.Multiplied(2));
|
pm1 = pm1.Translated(vsymper.Multiplied(2));
|
||||||
cursor(5).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
aPrims->AddVertex(pm1);
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(cursor);
|
|
||||||
|
|
||||||
vsym.Multiply(4);
|
vsym.Multiply(4);
|
||||||
V(1).SetCoord(pm.Translated(vsym).X(),
|
|
||||||
pm.Translated(vsym).Y(),
|
|
||||||
pm.Translated(vsym).Z());
|
|
||||||
V(2).SetCoord(pm.Translated(vsym.Reversed()).X(),
|
|
||||||
pm.Translated(vsym.Reversed()).Y(),
|
|
||||||
pm.Translated(vsym.Reversed()).Z());
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddBound(2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
aPrims->AddVertex(pm.Translated(vsym));
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(pm.Translated(vsym.Reversed()));
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===================================================================
|
//===================================================================
|
||||||
@ -522,6 +457,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
{
|
{
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
gp_Pnt OffsetPnt(OffsetPoint.X(),OffsetPoint.Y(),OffsetPoint.Z());
|
gp_Pnt OffsetPnt(OffsetPoint.X(),OffsetPoint.Y(),OffsetPoint.Z());
|
||||||
gp_Pnt Center1 = aCircle1.Location();
|
gp_Pnt Center1 = aCircle1.Location();
|
||||||
gp_Pnt ProjOffsetPoint = ElCLib::Value(ElCLib::Parameter(aAxis,OffsetPnt),aAxis);
|
gp_Pnt ProjOffsetPoint = ElCLib::Value(ElCLib::Parameter(aAxis,OffsetPnt),aAxis);
|
||||||
@ -529,7 +465,6 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
gp_Vec Vp(ProjCenter1,Center1);
|
gp_Vec Vp(ProjCenter1,Center1);
|
||||||
if (Vp.Magnitude() <= Precision::Confusion()) Vp = gp_Vec(aAxis.Direction())^aCircle1.Position().Direction();
|
if (Vp.Magnitude() <= Precision::Confusion()) Vp = gp_Vec(aAxis.Direction())^aCircle1.Position().Direction();
|
||||||
|
|
||||||
|
|
||||||
Standard_Real Dt,R,h;
|
Standard_Real Dt,R,h;
|
||||||
Dt = ProjCenter1.Distance(ProjOffsetPoint);
|
Dt = ProjCenter1.Distance(ProjOffsetPoint);
|
||||||
R = aCircle1.Radius();
|
R = aCircle1.Radius();
|
||||||
@ -553,10 +488,6 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
if (parcur < parmin) parmin = parcur;
|
if (parcur < parmin) parmin = parcur;
|
||||||
if (parcur > parmax) parmax = parcur;
|
if (parcur > parmax) parmax = parcur;
|
||||||
parcur = ElCLib::Parameter(L3,OffsetPnt);
|
parcur = ElCLib::Parameter(L3,OffsetPnt);
|
||||||
#ifdef DEB
|
|
||||||
gp_Pnt offp =
|
|
||||||
#endif
|
|
||||||
ElCLib::Value(parcur,L3);
|
|
||||||
|
|
||||||
Standard_Boolean outside = Standard_False;
|
Standard_Boolean outside = Standard_False;
|
||||||
if (parcur < parmin) {
|
if (parcur < parmin) {
|
||||||
@ -569,32 +500,23 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
}
|
}
|
||||||
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
||||||
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
Quantity_Length X,Y,Z;
|
|
||||||
|
|
||||||
//==== PROCESSING OF FACE ===========
|
//==== PROCESSING OF FACE ===========
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
aPrims->AddVertex(PointMin);
|
||||||
PointMin.Coord(X,Y,Z);
|
aPrims->AddVertex(PointMax);
|
||||||
V(1).SetCoord(X,Y,Z);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
PointMax.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
//==== PROCESSING OF CALL 1 =====
|
//==== PROCESSING OF CALL 1 =====
|
||||||
Standard_Integer nbp = 10;
|
Standard_Integer nbp = 10;
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Standard_Real ParamP1 = ElCLib::Parameter(aCircle1,P1);
|
Standard_Real ParamP1 = ElCLib::Parameter(aCircle1,P1);
|
||||||
Standard_Real ParamPAttach1 = ElCLib::Parameter(aCircle1,AttachmentPoint1);
|
Standard_Real ParamPAttach1 = ElCLib::Parameter(aCircle1,AttachmentPoint1);
|
||||||
// gp_Vec Center1_PAttach1(Center1,AttachmentPoint1);
|
|
||||||
// gp_Vec Center1_P1(Center1,P1);
|
|
||||||
Standard_Real alpha,Dalpha,alphaIter;
|
Standard_Real alpha,Dalpha,alphaIter;
|
||||||
|
|
||||||
alpha = fabs(ParamP1 - ParamPAttach1);
|
alpha = fabs(ParamP1 - ParamPAttach1);
|
||||||
if(ParamP1 < ParamPAttach1){
|
if(ParamP1 < ParamPAttach1){
|
||||||
if(alpha > M_PI){
|
if(alpha > M_PI){
|
||||||
alpha = (2*M_PI) - alpha;
|
alpha = (2.*M_PI) - alpha;
|
||||||
nbp = (Standard_Integer ) IntegerPart(alpha/(alpha*.02));
|
nbp = (Standard_Integer ) IntegerPart(alpha/(alpha*.02));
|
||||||
Dalpha = alpha/(nbp - 1);
|
Dalpha = alpha/(nbp - 1);
|
||||||
}
|
}
|
||||||
@ -605,7 +527,7 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if(alpha > M_PI){
|
if(alpha > M_PI){
|
||||||
alpha = (2*M_PI) - alpha;
|
alpha = (2.*M_PI) - alpha;
|
||||||
nbp = (Standard_Integer ) IntegerPart(alpha/(alpha*.02));
|
nbp = (Standard_Integer ) IntegerPart(alpha/(alpha*.02));
|
||||||
Dalpha = -alpha/(nbp - 1);
|
Dalpha = -alpha/(nbp - 1);
|
||||||
}
|
}
|
||||||
@ -615,28 +537,17 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex Vc1(1,nbp);
|
aPrims = new Graphic3d_ArrayOfPolylines(nbp);
|
||||||
AttachmentPoint1.Coord(X,Y,Z);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
Vc1(1).SetCoord(X,Y,Z);
|
|
||||||
alphaIter = Dalpha;
|
alphaIter = Dalpha;
|
||||||
gp_Pnt PntIter;
|
gp_Pnt PntIter;
|
||||||
Standard_Integer i ;
|
Standard_Integer i;
|
||||||
for( i = 2; i <= nbp; i++){
|
for(i = 2; i <= nbp; i++, alphaIter += Dalpha)
|
||||||
PntIter = ElCLib::Value(ParamPAttach1 + alphaIter,aCircle1);
|
aPrims->AddVertex(ElCLib::Value(ParamPAttach1 + alphaIter,aCircle1));
|
||||||
alphaIter = alphaIter + Dalpha;
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
PntIter.Coord(X,Y,Z);
|
|
||||||
Vc1(i).SetCoord(X,Y,Z);
|
|
||||||
|
|
||||||
}
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vc1);
|
|
||||||
|
|
||||||
//==== PROCESSING OF CALL 2 =====
|
//==== PROCESSING OF CALL 2 =====
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
gp_Pnt Center2 = ProjCenter1.Translated(Vp.Reversed());
|
gp_Pnt Center2 = ProjCenter1.Translated(Vp.Reversed());
|
||||||
// gp_Vec Center2_PAttach2(Center2,AttachmentPoint2);
|
|
||||||
// gp_Vec Center2_P2(Center2,P2);
|
|
||||||
|
|
||||||
gp_Dir DirC2 = aCircle1.Axis().Direction();
|
gp_Dir DirC2 = aCircle1.Axis().Direction();
|
||||||
gp_Ax2 AxeC2(Center2,DirC2);
|
gp_Ax2 AxeC2(Center2,DirC2);
|
||||||
gp_Circ aCircle2(AxeC2,aCircle1.Radius());
|
gp_Circ aCircle2(AxeC2,aCircle1.Radius());
|
||||||
@ -668,17 +579,12 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex Vc2(1,nbp);
|
aPrims = new Graphic3d_ArrayOfPolylines(nbp);
|
||||||
AttachmentPoint2.Coord(X,Y,Z);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
Vc2(1).SetCoord(X,Y,Z);
|
|
||||||
alphaIter = Dalpha;
|
alphaIter = Dalpha;
|
||||||
for(i = 2; i <= nbp; i++){
|
for(i = 2; i <= nbp; i++, alphaIter += Dalpha)
|
||||||
PntIter = ElCLib::Value(ParamPAttach2 + alphaIter,aCircle2);
|
aPrims->AddVertex(ElCLib::Value(ParamPAttach2 + alphaIter,aCircle2));
|
||||||
alphaIter = alphaIter + Dalpha;
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
PntIter.Coord(X,Y,Z);
|
|
||||||
Vc2(i).SetCoord(X,Y,Z);
|
|
||||||
}
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vc2);
|
|
||||||
|
|
||||||
//==== ARROWS ================
|
//==== ARROWS ================
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
@ -688,14 +594,10 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
gp_Dir arrdir = L3.Direction().Reversed();
|
gp_Dir arrdir = L3.Direction().Reversed();
|
||||||
if (outside) arrdir.Reverse();
|
if (outside) arrdir.Reverse();
|
||||||
// arrow 1 ----
|
// arrow 1 ----
|
||||||
Prs3d_Arrow::Draw(aPresentation,P1,arrdir,
|
Prs3d_Arrow::Draw(aPresentation,P1,arrdir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
|
||||||
LA->Arrow1Aspect()->Angle(),
|
|
||||||
LA->Arrow1Aspect()->Length());
|
|
||||||
|
|
||||||
// arrow 2 ----
|
// arrow 2 ----
|
||||||
Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),
|
Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),LA->Arrow2Aspect()->Angle(),LA->Arrow2Aspect()->Length());
|
||||||
LA->Arrow2Aspect()->Angle(),
|
|
||||||
LA->Arrow2Aspect()->Length());
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
//| SYMBOL OF SYMMETRY |
|
//| SYMBOL OF SYMMETRY |
|
||||||
@ -706,9 +608,8 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
// ------- : Inferior Segment
|
// ------- : Inferior Segment
|
||||||
|
|
||||||
gp_Vec Vvar(P1,P2);
|
gp_Vec Vvar(P1,P2);
|
||||||
gp_Vec vec;
|
|
||||||
gp_Vec Vtmp = Vvar.Divided(Vvar.Magnitude()).Multiplied(2*(aAxis.Distance(Center1)));
|
gp_Vec Vtmp = Vvar.Divided(Vvar.Magnitude()).Multiplied(2*(aAxis.Distance(Center1)));
|
||||||
vec.SetCoord(Vtmp.X(),Vtmp.Y(),Vtmp.Z());
|
gp_Vec vec = Vtmp;
|
||||||
gp_Vec vecA = vec.Multiplied(.1);
|
gp_Vec vecA = vec.Multiplied(.1);
|
||||||
|
|
||||||
gp_Dir DirAxis = aAxis.Direction();
|
gp_Dir DirAxis = aAxis.Direction();
|
||||||
@ -716,48 +617,36 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
gp_Vec vecB = Vaxe.Multiplied(vecA.Magnitude());
|
gp_Vec vecB = Vaxe.Multiplied(vecA.Magnitude());
|
||||||
vecB.Multiply(.5);
|
vecB.Multiply(.5);
|
||||||
|
|
||||||
//gp_Vec vecB(-vec.Y(),vec.X(),vec.Z());
|
gp_Pnt pm = P1.Translated(Vvar.Multiplied(.5));
|
||||||
//vecB.Multiply(.05);
|
gp_Pnt pOff = OffsetPnt.Translated(vecB);
|
||||||
gp_Pnt pm,pOff;
|
|
||||||
pm = P1.Translated(Vvar.Multiplied(.5));
|
|
||||||
pOff = OffsetPnt.Translated(vecB);
|
|
||||||
|
|
||||||
//Calculation of extremas of the axis of the symbol
|
//Calculation of extremas of the axis of the symbol
|
||||||
gp_Vec vecAxe = vecA.Multiplied(.7);
|
gp_Vec vecAxe = vecA.Multiplied(.7);
|
||||||
pOff.Translated(vecAxe).Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
pOff.Translated(vecAxe.Reversed()).Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
aPrims = new Graphic3d_ArrayOfPolylines(13,5);
|
||||||
|
|
||||||
|
aPrims->AddBound(2);
|
||||||
|
aPrims->AddVertex(pOff.Translated(vecAxe));
|
||||||
|
aPrims->AddVertex(pOff.Translated(vecAxe.Reversed()));
|
||||||
|
|
||||||
//Calculation of extremas of the superior segment of the symbol
|
//Calculation of extremas of the superior segment of the symbol
|
||||||
gp_Vec vec1 = vecAxe.Multiplied(.6);
|
gp_Vec vec1 = vecAxe.Multiplied(.6);
|
||||||
|
|
||||||
vecAxe = Vaxe.Multiplied(vecAxe.Magnitude());
|
vecAxe = Vaxe.Multiplied(vecAxe.Magnitude());
|
||||||
//vecAxe.SetCoord(-vecAxe.Y(),vecAxe.X(),vecAxe.Z());
|
|
||||||
|
|
||||||
gp_Vec vec2 = vecAxe.Multiplied(.4);
|
gp_Vec vec2 = vecAxe.Multiplied(.4);
|
||||||
|
|
||||||
pOff.Translated(vec1.Added(vec2)).Coord(X,Y,Z);
|
aPrims->AddBound(2);
|
||||||
V(1).SetCoord(X,Y,Z);
|
aPrims->AddVertex(pOff.Translated(vec1.Added(vec2)));
|
||||||
pOff.Translated(vec1.Reversed().Added(vec2)).Coord(X,Y,Z);
|
aPrims->AddVertex(pOff.Translated(vec1.Reversed().Added(vec2)));
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
//Calculation of extremas of the inferior segment of the symbol
|
//Calculation of extremas of the inferior segment of the symbol
|
||||||
pOff.Translated(vec1.Added(vec2.Reversed())).Coord(X,Y,Z);
|
aPrims->AddBound(2);
|
||||||
V(1).SetCoord(X,Y,Z);
|
aPrims->AddVertex(pOff.Translated(vec1.Added(vec2.Reversed())));
|
||||||
pOff.Translated(vec1.Reversed().Added(vec2.Reversed())).Coord(X,Y,Z);
|
aPrims->AddVertex(pOff.Translated(vec1.Reversed().Added(vec2.Reversed())));
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
/*//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
//| MARKING OF THE AXIS OF SYMMETRY |
|
//| MARKING OF THE AXIS OF SYMMETRY |
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
// ____
|
// ____
|
||||||
@ -765,42 +654,32 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
// \/
|
// \/
|
||||||
// /\
|
// /\
|
||||||
// /__\
|
// /__\
|
||||||
*/
|
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex cursor(1,5);
|
|
||||||
//Standard_Real Dist = aCircle1.Radius()/37;
|
|
||||||
Standard_Real Dist = aAxis.Distance(Center1)/37;
|
Standard_Real Dist = aAxis.Distance(Center1)/37;
|
||||||
gp_Dir aDirectionAxis = aAxis.Direction();
|
gp_Dir aDirectionAxis = aAxis.Direction();
|
||||||
gp_Vec vs(aDirectionAxis);
|
gp_Vec vs(aDirectionAxis);
|
||||||
gp_Vec vsym(vs.Divided(vs.Magnitude()).Multiplied(Dist).XYZ());
|
gp_Vec vsym(vs.Divided(vs.Magnitude()).Multiplied(Dist).XYZ());
|
||||||
|
|
||||||
gp_Vec vsymper(vsym.Y(),-vsym.X(),vsym.Z());
|
gp_Vec vsymper(vsym.Y(),-vsym.X(),vsym.Z());
|
||||||
gp_Pnt pm1 = pm.Translated(vsym.Added(vsymper));
|
|
||||||
cursor(1).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
|
||||||
pm1 = pm1.Translated(vsym.Reversed().Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
|
|
||||||
cursor(2).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
|
||||||
pm1 = pm1.Translated(vsymper.Multiplied(2));
|
|
||||||
cursor(3).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
|
||||||
pm1 = pm1.Translated(vsym.Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
|
|
||||||
cursor(4).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
|
||||||
pm1 = pm1.Translated(vsymper.Multiplied(2));
|
|
||||||
cursor(5).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddBound(5);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
gp_Pnt pm1 = pm.Translated(vsym.Added(vsymper));
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(cursor);
|
aPrims->AddVertex(pm1);
|
||||||
|
pm1 = pm1.Translated(vsym.Reversed().Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
|
||||||
|
aPrims->AddVertex(pm1);
|
||||||
|
pm1 = pm1.Translated(vsymper.Multiplied(2));
|
||||||
|
aPrims->AddVertex(pm1);
|
||||||
|
pm1 = pm1.Translated(vsym.Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
|
||||||
|
aPrims->AddVertex(pm1);
|
||||||
|
pm1 = pm1.Translated(vsymper.Multiplied(2));
|
||||||
|
aPrims->AddVertex(pm1);
|
||||||
|
|
||||||
vsym.Multiply(4);
|
vsym.Multiply(4);
|
||||||
V(1).SetCoord(pm.Translated(vsym).X(),
|
|
||||||
pm.Translated(vsym).Y(),
|
|
||||||
pm.Translated(vsym).Z());
|
|
||||||
V(2).SetCoord(pm.Translated(vsym.Reversed()).X(),
|
|
||||||
pm.Translated(vsym.Reversed()).Y(),
|
|
||||||
pm.Translated(vsym.Reversed()).Z());
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddBound(2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
aPrims->AddVertex(pm.Translated(vsym));
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(pm.Translated(vsym.Reversed()));
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
|
|
||||||
//===================================================================
|
//===================================================================
|
||||||
@ -817,7 +696,8 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
if (AttachmentPoint1.IsEqual(AttachmentPoint2,Precision::Confusion())){
|
if (AttachmentPoint1.IsEqual(AttachmentPoint2,Precision::Confusion()))
|
||||||
|
{
|
||||||
//==============================================================
|
//==============================================================
|
||||||
// SYMMETRY WHEN THE REFERENCE POINT IS ON THE AXIS OF SYM.:
|
// SYMMETRY WHEN THE REFERENCE POINT IS ON THE AXIS OF SYM.:
|
||||||
//==============================================================
|
//==============================================================
|
||||||
@ -831,22 +711,17 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
LA->LineAspect()->Aspect()->Values(acolor, atype, awidth);
|
LA->LineAspect()->Aspect()->Values(acolor, atype, awidth);
|
||||||
MarkerAsp->SetColor(acolor);
|
MarkerAsp->SetColor(acolor);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAsp);
|
||||||
Graphic3d_Vertex V3d(AttachmentPoint1.X(),
|
Graphic3d_Vertex V3d(AttachmentPoint1.X(),AttachmentPoint1.Y(),AttachmentPoint1.Z());
|
||||||
AttachmentPoint1.Y(),
|
|
||||||
AttachmentPoint1.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
|
Prs3d_Root::CurrentGroup(aPresentation)->Marker(V3d);
|
||||||
|
|
||||||
//Trace of the linking segment
|
//Trace of the linking segment
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
Graphic3d_Array1OfVertex Vrac(1,2);
|
|
||||||
Vrac(1).SetCoord(AttachmentPoint1.X(),
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(8);
|
||||||
AttachmentPoint1.Y(),
|
|
||||||
AttachmentPoint1.Z());
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
Vrac(2).SetCoord(OffsetPoint.X(),
|
aPrims->AddVertex(OffsetPoint);
|
||||||
OffsetPoint.Y(),
|
|
||||||
OffsetPoint.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrac);
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
//| SYMBOL OF SYMMETRY |
|
//| SYMBOL OF SYMMETRY |
|
||||||
@ -860,37 +735,33 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
gp_Vec uVAO = VAO.Divided(VAO.Magnitude());
|
gp_Vec uVAO = VAO.Divided(VAO.Magnitude());
|
||||||
gp_Pnt pDaxe = OffsetPoint.Translated(uVAO.Multiplied(3.));
|
gp_Pnt pDaxe = OffsetPoint.Translated(uVAO.Multiplied(3.));
|
||||||
gp_Pnt pFaxe = pDaxe.Translated(uVAO.Multiplied(12.));
|
gp_Pnt pFaxe = pDaxe.Translated(uVAO.Multiplied(12.));
|
||||||
Vrac(1).SetCoord(pDaxe.X(),pDaxe.Y(),pDaxe.Z());
|
|
||||||
Vrac(2).SetCoord(pFaxe.X(),pFaxe.Y(),pFaxe.Z());
|
aPrims->AddVertex(pDaxe);
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddVertex(pFaxe);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrac);
|
|
||||||
|
|
||||||
//Calculate extremas of the superior segment of the symbol
|
//Calculate extremas of the superior segment of the symbol
|
||||||
gp_Vec nVAO (-uVAO.Y(),uVAO.X(),uVAO.Z());
|
gp_Vec nVAO (-uVAO.Y(),uVAO.X(),uVAO.Z());
|
||||||
gp_Pnt sgP11 = pDaxe.Translated(uVAO.Multiplied(2.).Added(nVAO.Multiplied(2.)));
|
gp_Pnt sgP11 = pDaxe.Translated(uVAO.Multiplied(2.).Added(nVAO.Multiplied(2.)));
|
||||||
gp_Pnt sgP12 = sgP11.Translated(uVAO.Multiplied(8.));
|
gp_Pnt sgP12 = sgP11.Translated(uVAO.Multiplied(8.));
|
||||||
Vrac(1).SetCoord(sgP11.X(),sgP11.Y(),sgP11.Z());
|
|
||||||
Vrac(2).SetCoord(sgP12.X(),sgP12.Y(),sgP12.Z());
|
aPrims->AddVertex(sgP11);
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddVertex(sgP12);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrac);
|
|
||||||
|
|
||||||
//Calculate extremas of the inferior segment of the symbol
|
//Calculate extremas of the inferior segment of the symbol
|
||||||
gp_Vec nVAOr = nVAO.Reversed();
|
gp_Vec nVAOr = nVAO.Reversed();
|
||||||
gp_Pnt sgP21 = pDaxe.Translated(uVAO.Multiplied(2.).Added(nVAOr.Multiplied(2.)));
|
gp_Pnt sgP21 = pDaxe.Translated(uVAO.Multiplied(2.).Added(nVAOr.Multiplied(2.)));
|
||||||
gp_Pnt sgP22 = sgP21.Translated(uVAO.Multiplied(8.));
|
gp_Pnt sgP22 = sgP21.Translated(uVAO.Multiplied(8.));
|
||||||
Vrac(1).SetCoord(sgP21.X(),sgP21.Y(),sgP21.Z());
|
|
||||||
Vrac(2).SetCoord(sgP22.X(),sgP22.Y(),sgP22.Z());
|
aPrims->AddVertex(sgP21);
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddVertex(sgP22);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(Vrac);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
//==============================================================
|
//==============================================================
|
||||||
// OTHER CASES :
|
// OTHER CASES :
|
||||||
//==============================================================
|
//==============================================================
|
||||||
|
|
||||||
else{
|
else {
|
||||||
gp_Pnt ProjOffsetPoint = ElCLib::Value(ElCLib::Parameter(aAxis,OffsetPoint),aAxis);
|
gp_Pnt ProjOffsetPoint = ElCLib::Value(ElCLib::Parameter(aAxis,OffsetPoint),aAxis);
|
||||||
gp_Pnt ProjAttachmentPoint1 = ElCLib::Value(ElCLib::Parameter(aAxis,AttachmentPoint1),aAxis);
|
gp_Pnt ProjAttachmentPoint1 = ElCLib::Value(ElCLib::Parameter(aAxis,AttachmentPoint1),aAxis);
|
||||||
gp_Vec PjAtt1_Att1(ProjAttachmentPoint1,AttachmentPoint1);
|
gp_Vec PjAtt1_Att1(ProjAttachmentPoint1,AttachmentPoint1);
|
||||||
@ -906,10 +777,6 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
if (parcur < parmin) parmin = parcur;
|
if (parcur < parmin) parmin = parcur;
|
||||||
if (parcur > parmax) parmax = parcur;
|
if (parcur > parmax) parmax = parcur;
|
||||||
parcur = ElCLib::Parameter(L3,OffsetPoint);
|
parcur = ElCLib::Parameter(L3,OffsetPoint);
|
||||||
#ifdef DEB
|
|
||||||
gp_Pnt offp =
|
|
||||||
#endif
|
|
||||||
ElCLib::Value(parcur,L3);
|
|
||||||
|
|
||||||
Standard_Boolean outside = Standard_False;
|
Standard_Boolean outside = Standard_False;
|
||||||
if (parcur < parmin) {
|
if (parcur < parmin) {
|
||||||
@ -922,57 +789,41 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
}
|
}
|
||||||
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
gp_Pnt PointMin = ElCLib::Value(parmin,L3);
|
||||||
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
gp_Pnt PointMax = ElCLib::Value(parmax,L3);
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
Quantity_Length X,Y,Z;
|
|
||||||
|
|
||||||
//==== PROCESSING OF FACE ===========
|
//==== PROCESSING OF FACE ===========
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
PointMin.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfSegments(6);
|
||||||
PointMax.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
aPrims->AddVertex(PointMin);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(PointMax);
|
||||||
|
|
||||||
//==== PROCESSING OF CALL 1 =====
|
//==== PROCESSING OF CALL 1 =====
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
aPrims->AddVertex(P1);
|
||||||
AttachmentPoint1.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
P1.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
//==== PROCESSING OF CALL 2 =====
|
//==== PROCESSING OF CALL 2 =====
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
aPrims->AddVertex(P2);
|
||||||
AttachmentPoint2.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
P2.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
//==== ARROWS ================
|
//==== ARROWS ================
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
|
|
||||||
if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) outside = Standard_True;
|
if (dist < (LA->Arrow1Aspect()->Length()+LA->Arrow2Aspect()->Length())) outside = Standard_True;
|
||||||
gp_Dir arrdir = L3.Direction().Reversed();
|
gp_Dir arrdir = L3.Direction().Reversed();
|
||||||
if (outside) arrdir.Reverse();
|
if (outside) arrdir.Reverse();
|
||||||
// arrow 1 ----
|
// arrow 1 ----
|
||||||
Prs3d_Arrow::Draw(aPresentation,P1,arrdir,
|
Prs3d_Arrow::Draw(aPresentation,P1,arrdir,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
|
||||||
LA->Arrow1Aspect()->Angle(),
|
|
||||||
LA->Arrow1Aspect()->Length());
|
|
||||||
|
|
||||||
// arrow 2 ----
|
// arrow 2 ----
|
||||||
Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),
|
Prs3d_Arrow::Draw(aPresentation,P2,arrdir.Reversed(),LA->Arrow2Aspect()->Angle(),LA->Arrow2Aspect()->Length());
|
||||||
LA->Arrow2Aspect()->Angle(),
|
|
||||||
LA->Arrow2Aspect()->Length());
|
|
||||||
|
|
||||||
//==== POINTS ================
|
//==== POINTS ================
|
||||||
//Marker of localization of attachment points:
|
//Marker of localization of attachment points:
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
Handle(Graphic3d_AspectMarker3d) MarkerAspAtt = new Graphic3d_AspectMarker3d();
|
Handle(Graphic3d_AspectMarker3d) MarkerAspAtt = new Graphic3d_AspectMarker3d();
|
||||||
MarkerAspAtt->SetType(Aspect_TOM_BALL);
|
MarkerAspAtt->SetType(Aspect_TOM_BALL);
|
||||||
MarkerAspAtt->SetScale(0.8);
|
MarkerAspAtt->SetScale(0.8);
|
||||||
@ -982,17 +833,13 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
LA->LineAspect()->Aspect()->Values(color, type, width);
|
LA->LineAspect()->Aspect()->Values(color, type, width);
|
||||||
MarkerAspAtt->SetColor(color);
|
MarkerAspAtt->SetColor(color);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAspAtt);
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAspAtt);
|
||||||
Graphic3d_Vertex Vatt1(AttachmentPoint1.X(),
|
Graphic3d_Vertex Vatt1(AttachmentPoint1.X(),AttachmentPoint1.Y(),AttachmentPoint1.Z());
|
||||||
AttachmentPoint1.Y(),
|
|
||||||
AttachmentPoint1.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Marker(Vatt1);
|
Prs3d_Root::CurrentGroup(aPresentation)->Marker(Vatt1);
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAspAtt);
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(MarkerAspAtt);
|
||||||
Graphic3d_Vertex Vatt2(AttachmentPoint2.X(),
|
Graphic3d_Vertex Vatt2(AttachmentPoint2.X(),AttachmentPoint2.Y(),AttachmentPoint2.Z());
|
||||||
AttachmentPoint2.Y(),
|
|
||||||
AttachmentPoint2.Z());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Marker(Vatt2);
|
Prs3d_Root::CurrentGroup(aPresentation)->Marker(Vatt2);
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
@ -1011,49 +858,36 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
gp_Vec vecB = Vaxe.Multiplied(vecA.Magnitude());
|
gp_Vec vecB = Vaxe.Multiplied(vecA.Magnitude());
|
||||||
vecB.Multiply(.5);
|
vecB.Multiply(.5);
|
||||||
|
|
||||||
//gp_Vec vecB(-vec.Y(),vec.X(),vec.Z());
|
gp_Pnt pm = P1.Translated(vec.Multiplied(.5));
|
||||||
//vecB.Multiply(.05);
|
gp_Pnt pOff = OffsetPoint.Translated(vecB);
|
||||||
|
|
||||||
gp_Pnt pm,pOff;
|
|
||||||
pm = P1.Translated(vec.Multiplied(.5));
|
|
||||||
pOff = OffsetPoint.Translated(vecB);
|
|
||||||
|
|
||||||
//Calculate the extremas of the axis of the symbol
|
//Calculate the extremas of the axis of the symbol
|
||||||
gp_Vec vecAxe = vecA.Multiplied(.7);
|
gp_Vec vecAxe = vecA.Multiplied(.7);
|
||||||
pOff.Translated(vecAxe).Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
pOff.Translated(vecAxe.Reversed()).Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
aPrims = new Graphic3d_ArrayOfPolylines(13,5);
|
||||||
|
|
||||||
|
aPrims->AddBound(2);
|
||||||
|
aPrims->AddVertex(pOff.Translated(vecAxe));
|
||||||
|
aPrims->AddVertex(pOff.Translated(vecAxe.Reversed()));
|
||||||
|
|
||||||
//Calculate the extremas of the superior segment of the symbol
|
//Calculate the extremas of the superior segment of the symbol
|
||||||
gp_Vec vec1 = vecAxe.Multiplied(.6);
|
gp_Vec vec1 = vecAxe.Multiplied(.6);
|
||||||
|
|
||||||
vecAxe = Vaxe.Multiplied(vecAxe.Magnitude());
|
vecAxe = Vaxe.Multiplied(vecAxe.Magnitude());
|
||||||
|
|
||||||
//vecAxe.SetCoord(-vecAxe.Y(),vecAxe.X(),vecAxe.Z());
|
|
||||||
gp_Vec vec2 = vecAxe.Multiplied(.4);
|
gp_Vec vec2 = vecAxe.Multiplied(.4);
|
||||||
|
|
||||||
pOff.Translated(vec1.Added(vec2)).Coord(X,Y,Z);
|
aPrims->AddBound(2);
|
||||||
V(1).SetCoord(X,Y,Z);
|
aPrims->AddVertex(pOff.Translated(vec1.Added(vec2)));
|
||||||
pOff.Translated(vec1.Reversed().Added(vec2)).Coord(X,Y,Z);
|
aPrims->AddVertex(pOff.Translated(vec1.Reversed().Added(vec2)));
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
//Calculate the extremas of the inferior segment of the symbol
|
//Calculate the extremas of the inferior segment of the symbol
|
||||||
pOff.Translated(vec1.Added(vec2.Reversed())).Coord(X,Y,Z);
|
aPrims->AddBound(2);
|
||||||
V(1).SetCoord(X,Y,Z);
|
aPrims->AddVertex(pOff.Translated(vec1.Added(vec2.Reversed())));
|
||||||
pOff.Translated(vec1.Reversed().Added(vec2.Reversed())).Coord(X,Y,Z);
|
aPrims->AddVertex(pOff.Translated(vec1.Reversed().Added(vec2.Reversed())));
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
/* //--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
//| MARKING OF THE AXIS OF SYMMETRY |
|
//| MARKING OF THE AXIS OF SYMMETRY |
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
// ____
|
// ____
|
||||||
@ -1061,49 +895,31 @@ void DsgPrs_SymmetricPresentation::Add (const Handle(Prs3d_Presentation)& aPrese
|
|||||||
// \/
|
// \/
|
||||||
// /\
|
// /\
|
||||||
// /__\
|
// /__\
|
||||||
*/
|
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex cursor(1,5);
|
|
||||||
Standard_Real Dist = P1.Distance(P2)/75;
|
Standard_Real Dist = P1.Distance(P2)/75;
|
||||||
gp_Dir aDirectionAxis = aAxis.Direction();
|
gp_Dir aDirectionAxis = aAxis.Direction();
|
||||||
gp_Vec vs(aDirectionAxis);
|
gp_Vec vs(aDirectionAxis);
|
||||||
gp_Vec vsym(vs.Divided(vs.Magnitude()).Multiplied(Dist).XYZ());
|
gp_Vec vsym(vs.Divided(vs.Magnitude()).Multiplied(Dist).XYZ());
|
||||||
|
|
||||||
gp_Vec vsymper(vsym.Y(),-vsym.X(),vsym.Z());
|
gp_Vec vsymper(vsym.Y(),-vsym.X(),vsym.Z());
|
||||||
gp_Pnt pm1 = pm.Translated(vsym.Added(vsymper));
|
|
||||||
cursor(1).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
|
||||||
pm1 = pm1.Translated(vsym.Reversed().Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
|
|
||||||
cursor(2).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
|
||||||
pm1 = pm1.Translated(vsymper.Multiplied(2));
|
|
||||||
cursor(3).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
|
||||||
pm1 = pm1.Translated(vsym.Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
|
|
||||||
cursor(4).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
|
||||||
pm1 = pm1.Translated(vsymper.Multiplied(2));
|
|
||||||
cursor(5).SetCoord(pm1.X(),pm1.Y(),pm1.Z());
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddBound(5);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
gp_Pnt pm1 = pm.Translated(vsym.Added(vsymper));
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(cursor);
|
aPrims->AddVertex(pm1);
|
||||||
|
pm1 = pm1.Translated(vsym.Reversed().Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
|
||||||
|
aPrims->AddVertex(pm1);
|
||||||
|
pm1 = pm1.Translated(vsymper.Multiplied(2));
|
||||||
|
aPrims->AddVertex(pm1);
|
||||||
|
pm1 = pm1.Translated(vsym.Multiplied(2).Added(vsymper.Reversed().Multiplied(2)));
|
||||||
|
aPrims->AddVertex(pm1);
|
||||||
|
pm1 = pm1.Translated(vsymper.Multiplied(2));
|
||||||
|
aPrims->AddVertex(pm1);
|
||||||
|
|
||||||
vsym.Multiply(4);
|
vsym.Multiply(4);
|
||||||
V(1).SetCoord(pm.Translated(vsym).X(),
|
|
||||||
pm.Translated(vsym).Y(),
|
|
||||||
pm.Translated(vsym).Z());
|
|
||||||
V(2).SetCoord(pm.Translated(vsym.Reversed()).X(),
|
|
||||||
pm.Translated(vsym.Reversed()).Y(),
|
|
||||||
pm.Translated(vsym.Reversed()).Z());
|
|
||||||
|
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
aPrims->AddBound(2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
aPrims->AddVertex(pm.Translated(vsym));
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
aPrims->AddVertex(pm.Translated(vsym.Reversed()));
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,12 +18,10 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_TangentPresentation.ixx>
|
#include <DsgPrs_TangentPresentation.ixx>
|
||||||
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
#include <Prs3d_Arrow.hxx>
|
#include <Prs3d_Arrow.hxx>
|
||||||
#include <Prs3d_ArrowAspect.hxx>
|
#include <Prs3d_ArrowAspect.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
@ -57,27 +55,19 @@ void DsgPrs_TangentPresentation::Add (const Handle(Prs3d_Presentation)& aPresent
|
|||||||
|
|
||||||
// Array1OfVertex
|
// Array1OfVertex
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
Quantity_Length X,Y,Z;
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
p1.Coord(X,Y,Z);
|
aPrims->AddVertex(p1);
|
||||||
V(1).SetCoord(X,Y,Z);
|
aPrims->AddVertex(p2);
|
||||||
p2.Coord(X,Y,Z);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
// fleche 1 :
|
// fleche 1 :
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
Prs3d_Arrow::Draw(aPresentation,p1,aDirection,
|
Prs3d_Arrow::Draw(aPresentation,p1,aDirection,LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
|
||||||
LA->Arrow1Aspect()->Angle(),
|
|
||||||
LA->Arrow1Aspect()->Length());
|
|
||||||
|
|
||||||
// fleche 2
|
// fleche 2
|
||||||
Prs3d_Root::NewGroup(aPresentation);
|
Prs3d_Root::NewGroup(aPresentation);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
Prs3d_Arrow::Draw(aPresentation,p2,aDirection.Reversed(),
|
Prs3d_Arrow::Draw(aPresentation,p2,aDirection.Reversed(),LA->Arrow2Aspect()->Angle(),LA->Arrow2Aspect()->Length());
|
||||||
LA->Arrow2Aspect()->Angle(),
|
|
||||||
LA->Arrow2Aspect()->Length());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,15 +18,11 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#define OCC218 // SAV Enable to compute the triedhron color texts and arrows.
|
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_XYZAxisPresentation.ixx>
|
#include <DsgPrs_XYZAxisPresentation.ixx>
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
#include <Prs3d_Arrow.hxx>
|
#include <Prs3d_Arrow.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -43,24 +39,18 @@ void DsgPrs_XYZAxisPresentation::Add(
|
|||||||
const gp_Pnt& aPfirst,
|
const gp_Pnt& aPfirst,
|
||||||
const gp_Pnt& aPlast)
|
const gp_Pnt& aPlast)
|
||||||
{
|
{
|
||||||
|
Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPresentation);
|
||||||
|
G->SetPrimitivesAspect(aLineAspect->Aspect());
|
||||||
|
|
||||||
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(aPfirst);
|
||||||
|
aPrims->AddVertex(aPlast);
|
||||||
|
G->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPresentation);
|
Prs3d_Arrow::Draw(aPresentation,aPlast,aDir,M_PI/180.*10.,aVal/10.);
|
||||||
|
|
||||||
Quantity_Length xo,yo,zo,x,y,z;
|
|
||||||
|
|
||||||
aPfirst.Coord(xo,yo,zo);
|
|
||||||
aPlast.Coord(x,y,z);
|
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex A(1,2);
|
|
||||||
A(1).SetCoord(xo,yo,zo);
|
|
||||||
A(2).SetCoord(x,y,z);
|
|
||||||
|
|
||||||
G->SetPrimitivesAspect(aLineAspect->Aspect());
|
|
||||||
G->Polyline(A);
|
|
||||||
Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),aDir,M_PI/180.*10.,aVal/10.);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,A(2),1./81.);
|
|
||||||
|
|
||||||
|
Graphic3d_Vertex a2(aPlast.X(),aPlast.Y(),aPlast.Z());
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,a2,1./81.);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -74,23 +64,18 @@ void DsgPrs_XYZAxisPresentation::Add(const Handle(Prs3d_Presentation)& aPresenta
|
|||||||
const gp_Pnt& aPfirst,
|
const gp_Pnt& aPfirst,
|
||||||
const gp_Pnt& aPlast)
|
const gp_Pnt& aPlast)
|
||||||
{
|
{
|
||||||
#ifdef OCC218
|
|
||||||
Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPresentation);
|
Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPresentation);
|
||||||
|
|
||||||
Quantity_Length xo,yo,zo,x,y,z;
|
|
||||||
|
|
||||||
aPfirst.Coord(xo,yo,zo);
|
|
||||||
aPlast.Coord(x,y,z);
|
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex A(1,2);
|
|
||||||
A(1).SetCoord(xo,yo,zo);
|
|
||||||
A(2).SetCoord(x,y,z);
|
|
||||||
|
|
||||||
G->SetPrimitivesAspect(aLineAspect->Aspect());
|
G->SetPrimitivesAspect(aLineAspect->Aspect());
|
||||||
G->Polyline(A);
|
|
||||||
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
|
aPrims->AddVertex(aPfirst);
|
||||||
|
aPrims->AddVertex(aPlast);
|
||||||
|
G->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
G->SetPrimitivesAspect( anArrowAspect->Aspect() );
|
G->SetPrimitivesAspect( anArrowAspect->Aspect() );
|
||||||
Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),aDir,M_PI/180.*10.,aVal/10.);
|
Prs3d_Arrow::Draw(aPresentation,aPlast,aDir,M_PI/180.*10.,aVal/10.);
|
||||||
|
|
||||||
G->SetPrimitivesAspect(aTextAspect->Aspect());
|
G->SetPrimitivesAspect(aTextAspect->Aspect());
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,A(2),1./81.);
|
Graphic3d_Vertex a2(aPlast.X(),aPlast.Y(),aPlast.Z());
|
||||||
#endif
|
Prs3d_Root::CurrentGroup(aPresentation)->Text(aText,a2,1./81.);
|
||||||
}
|
}
|
||||||
|
@ -18,13 +18,12 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#include <DsgPrs_XYZPlanePresentation.ixx>
|
#include <DsgPrs_XYZPlanePresentation.ixx>
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
#include <Prs3d_PlaneAspect.hxx>
|
#include <Prs3d_PlaneAspect.hxx>
|
||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -39,23 +38,13 @@ void DsgPrs_XYZPlanePresentation::Add(
|
|||||||
const gp_Pnt& aPt2,
|
const gp_Pnt& aPt2,
|
||||||
const gp_Pnt& aPt3)
|
const gp_Pnt& aPt3)
|
||||||
{
|
{
|
||||||
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
||||||
|
TheGroup->SetPrimitivesAspect(aDrawer->PlaneAspect()->EdgesAspect()->Aspect());
|
||||||
|
|
||||||
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(4);
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
aPrims->AddVertex(aPt1);
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->PlaneAspect()->EdgesAspect()->Aspect());
|
aPrims->AddVertex(aPt2);
|
||||||
|
aPrims->AddVertex(aPt3);
|
||||||
Quantity_Length x1,y1,z1,x2,y2,z2,x3,y3,z3;
|
aPrims->AddVertex(aPt1);
|
||||||
|
TheGroup->AddPrimitiveArray(aPrims);
|
||||||
aPt1.Coord(x1,y1,z1);
|
|
||||||
aPt2.Coord(x2,y2,z2);
|
|
||||||
aPt3.Coord(x3,y3,z3);
|
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex A(1,4);
|
|
||||||
A(1).SetCoord(x1,y1,z1);
|
|
||||||
A(2).SetCoord(x2,y2,z2);
|
|
||||||
A(3).SetCoord(x3,y3,z3);
|
|
||||||
A(4).SetCoord(x1,y1,z1);
|
|
||||||
|
|
||||||
TheGroup->Polyline(A);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,6 @@ Graphic3d_Group.pxx
|
|||||||
Graphic3d_Group_1.cxx
|
Graphic3d_Group_1.cxx
|
||||||
Graphic3d_Group_2.cxx
|
Graphic3d_Group_2.cxx
|
||||||
Graphic3d_Group_3.cxx
|
Graphic3d_Group_3.cxx
|
||||||
Graphic3d_Group_5.cxx
|
|
||||||
Graphic3d_Group_7.cxx
|
|
||||||
Graphic3d_Group_8.cxx
|
Graphic3d_Group_8.cxx
|
||||||
Graphic3d_Group_10.cxx
|
Graphic3d_Group_10.cxx
|
||||||
Graphic3d_Structure.pxx
|
Graphic3d_Structure.pxx
|
||||||
@ -54,3 +52,5 @@ Graphic3d_BufferType.hxx
|
|||||||
Graphic3d_Vec2.hxx
|
Graphic3d_Vec2.hxx
|
||||||
Graphic3d_Vec3.hxx
|
Graphic3d_Vec3.hxx
|
||||||
Graphic3d_Vec4.hxx
|
Graphic3d_Vec4.hxx
|
||||||
|
Graphic3d_Vertex.hxx
|
||||||
|
Graphic3d_Vertex.cxx
|
||||||
|
@ -69,6 +69,7 @@ uses
|
|||||||
|
|
||||||
TCollection,
|
TCollection,
|
||||||
TColStd,
|
TColStd,
|
||||||
|
TColgp,
|
||||||
OSD,
|
OSD,
|
||||||
Quantity,
|
Quantity,
|
||||||
Aspect,
|
Aspect,
|
||||||
@ -502,26 +503,10 @@ is
|
|||||||
---Purpose: 3d vector
|
---Purpose: 3d vector
|
||||||
---Category: Classes
|
---Category: Classes
|
||||||
|
|
||||||
class Vertex;
|
imported Vertex;
|
||||||
---Purpose: 3d vertex
|
---Purpose: 3d vertex
|
||||||
---Category: Classes
|
---Category: Classes
|
||||||
|
|
||||||
class VertexN;
|
|
||||||
---Purpose: 3d vertex with a normal vector
|
|
||||||
---Category: Classes
|
|
||||||
|
|
||||||
class VertexNT;
|
|
||||||
---Purpose: 3d vertex with a normal vector and texture coordinate
|
|
||||||
---Category: Classes
|
|
||||||
|
|
||||||
class VertexC;
|
|
||||||
---Purpose: 3d vertex with a colour
|
|
||||||
---Category: Classes
|
|
||||||
|
|
||||||
class VertexNC;
|
|
||||||
---Purpose: 3d vertex with a normal and a colour
|
|
||||||
---Category: Classes
|
|
||||||
|
|
||||||
---------------------
|
---------------------
|
||||||
-- Category: Pointers
|
-- Category: Pointers
|
||||||
---------------------
|
---------------------
|
||||||
@ -589,38 +574,6 @@ is
|
|||||||
Array2 from TCollection (Vertex from Graphic3d);
|
Array2 from TCollection (Vertex from Graphic3d);
|
||||||
---Category: Instantiated classes
|
---Category: Instantiated classes
|
||||||
|
|
||||||
class Array1OfVertexC instantiates
|
|
||||||
Array1 from TCollection (VertexC from Graphic3d);
|
|
||||||
---Category: Instantiated classes
|
|
||||||
|
|
||||||
class Array2OfVertexC instantiates
|
|
||||||
Array2 from TCollection (VertexC from Graphic3d);
|
|
||||||
---Category: Instantiated classes
|
|
||||||
|
|
||||||
class Array1OfVertexN instantiates
|
|
||||||
Array1 from TCollection (VertexN from Graphic3d);
|
|
||||||
---Category: Instantiated classes
|
|
||||||
|
|
||||||
class Array2OfVertexN instantiates
|
|
||||||
Array2 from TCollection (VertexN from Graphic3d);
|
|
||||||
---Category: Instantiated classes
|
|
||||||
|
|
||||||
class Array1OfVertexNT instantiates
|
|
||||||
Array1 from TCollection (VertexNT from Graphic3d);
|
|
||||||
---Category: Instantiated classes
|
|
||||||
|
|
||||||
class Array2OfVertexNT instantiates
|
|
||||||
Array2 from TCollection (VertexNT from Graphic3d);
|
|
||||||
---Category: Instantiated classes
|
|
||||||
|
|
||||||
class Array1OfVertexNC instantiates
|
|
||||||
Array1 from TCollection (VertexNC from Graphic3d);
|
|
||||||
---Category: Instantiated classes
|
|
||||||
|
|
||||||
class Array2OfVertexNC instantiates
|
|
||||||
Array2 from TCollection (VertexNC from Graphic3d);
|
|
||||||
---Category: Instantiated classes
|
|
||||||
|
|
||||||
class ListOfShortReal instantiates
|
class ListOfShortReal instantiates
|
||||||
List from TCollection (ShortReal from Standard);
|
List from TCollection (ShortReal from Standard);
|
||||||
---Category: Instantiated classes
|
---Category: Instantiated classes
|
||||||
|
@ -85,7 +85,27 @@ is
|
|||||||
-- -------------------------------------------------------------------
|
-- -------------------------------------------------------------------
|
||||||
|
|
||||||
AddVertex( me:mutable;
|
AddVertex( me:mutable;
|
||||||
aVertice: Pnt from gp)
|
aVertice: Pnt from gp)
|
||||||
|
returns Integer from Standard
|
||||||
|
---Level: Public
|
||||||
|
---Purpose: Adds a vertice in the array.
|
||||||
|
-- returns the actual vertex number.
|
||||||
|
raises OutOfRange from Standard;
|
||||||
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
---C++: inline
|
||||||
|
|
||||||
|
AddVertex( me:mutable;
|
||||||
|
X,Y,Z: Real from Standard)
|
||||||
|
returns Integer from Standard
|
||||||
|
---Level: Public
|
||||||
|
---Purpose: Adds a vertice in the array.
|
||||||
|
-- returns the actual vertex number.
|
||||||
|
raises OutOfRange from Standard;
|
||||||
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
---C++: inline
|
||||||
|
|
||||||
|
AddVertex( me:mutable;
|
||||||
|
X,Y,Z: ShortReal from Standard)
|
||||||
returns Integer from Standard
|
returns Integer from Standard
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Adds a vertice in the array.
|
---Purpose: Adds a vertice in the array.
|
||||||
@ -94,17 +114,8 @@ is
|
|||||||
-- if the actual vertex number is >= <maxVertexs>
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
|
||||||
AddVertex( me:mutable;
|
AddVertex( me:mutable;
|
||||||
X,Y,Z: Real from Standard)
|
aVertice: Pnt from gp;
|
||||||
returns Integer from Standard
|
aColor: Color from Quantity)
|
||||||
---Level: Public
|
|
||||||
---Purpose: Adds a vertice in the array.
|
|
||||||
-- returns the actual vertex number.
|
|
||||||
raises OutOfRange from Standard;
|
|
||||||
-- if the actual vertex number is >= <maxVertexs>
|
|
||||||
|
|
||||||
AddVertex( me:mutable;
|
|
||||||
aVertice: Pnt from gp;
|
|
||||||
aColor: Color from Quantity)
|
|
||||||
returns Integer from Standard
|
returns Integer from Standard
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Adds a vertice and vertex color in the vertex array.
|
---Purpose: Adds a vertice and vertex color in the vertex array.
|
||||||
@ -117,7 +128,7 @@ is
|
|||||||
AddVertex( me : mutable;
|
AddVertex( me : mutable;
|
||||||
aVertice : Pnt from gp;
|
aVertice : Pnt from gp;
|
||||||
aColor : Integer from Standard)
|
aColor : Integer from Standard)
|
||||||
returns Integer from Standard
|
returns Integer from Standard
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Adds a vertice and vertex color in the vertex array.
|
---Purpose: Adds a vertice and vertex color in the vertex array.
|
||||||
-- returns the actual vertex number.
|
-- returns the actual vertex number.
|
||||||
@ -129,12 +140,37 @@ is
|
|||||||
raises OutOfRange from Standard;
|
raises OutOfRange from Standard;
|
||||||
-- if the actual vertex number is >= <maxVertexs>
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
|
||||||
|
|
||||||
AddVertex( me :mutable;
|
AddVertex( me :mutable;
|
||||||
aVertice : Pnt from gp;
|
aVertice : Pnt from gp;
|
||||||
aNormal : Dir from gp)
|
aNormal : Dir from gp)
|
||||||
returns Integer from Standard
|
returns Integer from Standard
|
||||||
---Level: Public
|
---Level: Public
|
||||||
|
---Purpose: Adds a vertice and vertex normal in the vertex array.
|
||||||
|
-- returns the actual vertex number.
|
||||||
|
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||||
|
-- constructor parameter is FALSE.
|
||||||
|
raises OutOfRange from Standard;
|
||||||
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
---C++: inline
|
||||||
|
|
||||||
|
AddVertex( me:mutable;
|
||||||
|
X,Y,Z: Real from Standard;
|
||||||
|
NX,NY,NZ: Real from Standard)
|
||||||
|
returns Integer from Standard
|
||||||
|
---Level: Public
|
||||||
|
---Purpose: Adds a vertice and vertex normal in the vertex array.
|
||||||
|
-- returns the actual vertex number.
|
||||||
|
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||||
|
-- constructor parameter is FALSE.
|
||||||
|
raises OutOfRange from Standard;
|
||||||
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
---C++: inline
|
||||||
|
|
||||||
|
AddVertex( me:mutable;
|
||||||
|
X,Y,Z: ShortReal from Standard;
|
||||||
|
NX,NY,NZ: ShortReal from Standard)
|
||||||
|
returns Integer from Standard
|
||||||
|
---Level: Public
|
||||||
---Purpose: Adds a vertice and vertex normal in the vertex array.
|
---Purpose: Adds a vertice and vertex normal in the vertex array.
|
||||||
-- returns the actual vertex number.
|
-- returns the actual vertex number.
|
||||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||||
@ -143,23 +179,11 @@ is
|
|||||||
-- if the actual vertex number is >= <maxVertexs>
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
|
||||||
AddVertex( me:mutable;
|
AddVertex( me:mutable;
|
||||||
X,Y,Z: Real from Standard;
|
aVertice: Pnt from gp;
|
||||||
NX,NY,NZ: Real from Standard)
|
aNormal: Dir from gp;
|
||||||
returns Integer from Standard
|
aColor: Color from Quantity)
|
||||||
---Level: Public
|
returns Integer from Standard
|
||||||
---Purpose: Adds a vertice and vertex normal in the vertex array.
|
---Level: Public
|
||||||
-- returns the actual vertex number.
|
|
||||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
|
||||||
-- constructor parameter is FALSE.
|
|
||||||
raises OutOfRange from Standard;
|
|
||||||
-- if the actual vertex number is >= <maxVertexs>
|
|
||||||
|
|
||||||
AddVertex( me:mutable;
|
|
||||||
aVertice: Pnt from gp;
|
|
||||||
aNormal: Dir from gp;
|
|
||||||
aColor: Color from Quantity)
|
|
||||||
returns Integer from Standard
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Adds a vertice,vertex normal and color in the vertex array.
|
---Purpose: Adds a vertice,vertex normal and color in the vertex array.
|
||||||
-- returns the actual vertex number.
|
-- returns the actual vertex number.
|
||||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||||
@ -173,7 +197,7 @@ is
|
|||||||
aVertice : Pnt from gp;
|
aVertice : Pnt from gp;
|
||||||
aNormal : Dir from gp;
|
aNormal : Dir from gp;
|
||||||
aColor : Integer from Standard)
|
aColor : Integer from Standard)
|
||||||
returns Integer from Standard
|
returns Integer from Standard
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Adds a vertice,vertex normal and color in the vertex array.
|
---Purpose: Adds a vertice,vertex normal and color in the vertex array.
|
||||||
-- returns the actual vertex number.
|
-- returns the actual vertex number.
|
||||||
@ -187,24 +211,37 @@ is
|
|||||||
raises OutOfRange from Standard;
|
raises OutOfRange from Standard;
|
||||||
-- if the actual vertex number is >= <maxVertexs>
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
|
||||||
|
|
||||||
AddVertex( me:mutable;
|
AddVertex( me:mutable;
|
||||||
aVertice: Pnt from gp;
|
aVertice: Pnt from gp;
|
||||||
aTexel: Pnt2d from gp)
|
aTexel: Pnt2d from gp)
|
||||||
returns Integer from Standard
|
returns Integer from Standard
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Adds a vertice and vertex texture in the vertex array.
|
---Purpose: Adds a vertice and vertex texture in the vertex array.
|
||||||
-- returns the actual vertex number.
|
-- returns the actual vertex number.
|
||||||
-- <aTexel> is ignored when the <hasVTexels>
|
-- <aTexel> is ignored when the <hasVTexels>
|
||||||
-- constructor parameter is FALSE.
|
-- constructor parameter is FALSE.
|
||||||
raises OutOfRange from Standard;
|
raises OutOfRange from Standard;
|
||||||
-- if the actual vertex number is >= <maxVertexs>
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
---C++: inline
|
||||||
|
|
||||||
AddVertex( me:mutable;
|
AddVertex( me:mutable;
|
||||||
X,Y,Z: Real from Standard;
|
X,Y,Z: Real from Standard;
|
||||||
TX,TY: Real from Standard)
|
TX,TY: Real from Standard)
|
||||||
returns Integer from Standard
|
returns Integer from Standard
|
||||||
---Level: Public
|
---Level: Public
|
||||||
|
---Purpose: Adds a vertice and vertex texture coordinates in the vertex array.
|
||||||
|
-- returns the actual vertex number.
|
||||||
|
-- <aTexel> is ignored when the <hasVTexels>
|
||||||
|
-- constructor parameter is FALSE.
|
||||||
|
raises OutOfRange from Standard;
|
||||||
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
---C++: inline
|
||||||
|
|
||||||
|
AddVertex( me:mutable;
|
||||||
|
X,Y,Z: ShortReal from Standard;
|
||||||
|
TX,TY: ShortReal from Standard)
|
||||||
|
returns Integer from Standard
|
||||||
|
---Level: Public
|
||||||
---Purpose: Adds a vertice and vertex texture coordinates in the vertex array.
|
---Purpose: Adds a vertice and vertex texture coordinates in the vertex array.
|
||||||
-- returns the actual vertex number.
|
-- returns the actual vertex number.
|
||||||
-- <aTexel> is ignored when the <hasVTexels>
|
-- <aTexel> is ignored when the <hasVTexels>
|
||||||
@ -213,11 +250,11 @@ is
|
|||||||
-- if the actual vertex number is >= <maxVertexs>
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
|
||||||
AddVertex( me:mutable;
|
AddVertex( me:mutable;
|
||||||
aVertice: Pnt from gp;
|
aVertice: Pnt from gp;
|
||||||
aNormal: Dir from gp;
|
aNormal: Dir from gp;
|
||||||
aTexel: Pnt2d from gp)
|
aTexel: Pnt2d from gp)
|
||||||
returns Integer from Standard
|
returns Integer from Standard
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Adds a vertice,vertex normal and texture in the vertex array.
|
---Purpose: Adds a vertice,vertex normal and texture in the vertex array.
|
||||||
-- returns the actual vertex number.
|
-- returns the actual vertex number.
|
||||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||||
@ -226,13 +263,30 @@ is
|
|||||||
-- constructor parameter is FALSE.
|
-- constructor parameter is FALSE.
|
||||||
raises OutOfRange from Standard;
|
raises OutOfRange from Standard;
|
||||||
-- if the actual vertex number is >= <maxVertexs>
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
---C++: inline
|
||||||
|
|
||||||
AddVertex( me:mutable;
|
AddVertex( me:mutable;
|
||||||
X,Y,Z: Real from Standard;
|
X,Y,Z: Real from Standard;
|
||||||
NX,NY,NZ: Real from Standard;
|
NX,NY,NZ: Real from Standard;
|
||||||
TX,TY: Real from Standard)
|
TX,TY: Real from Standard)
|
||||||
returns Integer from Standard
|
returns Integer from Standard
|
||||||
---Level: Public
|
---Level: Public
|
||||||
|
---Purpose: Adds a vertice,vertex normal and texture in the vertex array.
|
||||||
|
-- returns the actual vertex number.
|
||||||
|
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||||
|
-- constructor parameter is FALSE.
|
||||||
|
-- <aTexel> is ignored when the <hasVTexels>
|
||||||
|
-- constructor parameter is FALSE.
|
||||||
|
raises OutOfRange from Standard;
|
||||||
|
-- if the actual vertex number is >= <maxVertexs>
|
||||||
|
---C++: inline
|
||||||
|
|
||||||
|
AddVertex( me:mutable;
|
||||||
|
X,Y,Z: ShortReal from Standard;
|
||||||
|
NX,NY,NZ: ShortReal from Standard;
|
||||||
|
TX,TY: ShortReal from Standard)
|
||||||
|
returns Integer from Standard
|
||||||
|
---Level: Public
|
||||||
---Purpose: Adds a vertice,vertex normal and texture in the vertex array.
|
---Purpose: Adds a vertice,vertex normal and texture in the vertex array.
|
||||||
-- returns the actual vertex number.
|
-- returns the actual vertex number.
|
||||||
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
-- Warning: <aNormal> is ignored when the <hasVNormals>
|
||||||
@ -252,8 +306,8 @@ is
|
|||||||
-- if the actual Bound number is >= <maxBounds>
|
-- if the actual Bound number is >= <maxBounds>
|
||||||
|
|
||||||
AddBound( me:mutable;
|
AddBound( me:mutable;
|
||||||
edgeNumber: Integer from Standard;
|
edgeNumber: Integer from Standard;
|
||||||
aBColor: Color from Quantity)
|
aBColor: Color from Quantity)
|
||||||
returns Integer from Standard
|
returns Integer from Standard
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Adds a bound of length <edgeNumber> and bound color
|
---Purpose: Adds a bound of length <edgeNumber> and bound color
|
||||||
@ -338,16 +392,16 @@ is
|
|||||||
-- or if the <aBoundIndex> parameter is < 1 or > ItemNumber()
|
-- or if the <aBoundIndex> parameter is < 1 or > ItemNumber()
|
||||||
|
|
||||||
SetVertice( me:mutable;
|
SetVertice( me:mutable;
|
||||||
anIndex: Integer from Standard;
|
anIndex: Integer from Standard;
|
||||||
aVertice: Pnt from gp)
|
aVertice: Pnt from gp)
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Change the vertice of rank <anIndex> in the array.
|
---Purpose: Change the vertice of rank <anIndex> in the array.
|
||||||
raises OutOfRange from Standard;
|
raises OutOfRange from Standard;
|
||||||
-- if the index is <1 or > VertexNumber()
|
-- if the index is <1 or > VertexNumber()
|
||||||
|
|
||||||
SetVertice( me:mutable;
|
SetVertice( me:mutable;
|
||||||
anIndex: Integer from Standard;
|
anIndex: Integer from Standard;
|
||||||
X,Y,Z: Real from Standard)
|
X,Y,Z: ShortReal from Standard)
|
||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Change the vertice of rank <anIndex> in the array.
|
---Purpose: Change the vertice of rank <anIndex> in the array.
|
||||||
raises OutOfRange from Standard;
|
raises OutOfRange from Standard;
|
||||||
@ -633,25 +687,6 @@ is
|
|||||||
-- Category Miscellaneous
|
-- Category Miscellaneous
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
|
|
||||||
Enable( myclass );
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Enable to use the arrays of primitives
|
|
||||||
-- Warning: Updates the current value of the environment symbol
|
|
||||||
-- CSF_USE_ARRAY_OF_PRIMITIVES
|
|
||||||
|
|
||||||
Disable( myclass );
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Disable to use the arrays of primitives
|
|
||||||
-- Warning: Updates the current value of the environment symbol
|
|
||||||
-- CSF_USE_ARRAY_OF_PRIMITIVES
|
|
||||||
|
|
||||||
IsEnable( myclass )
|
|
||||||
returns Boolean from Standard;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns TRUE when the arrays are enable to use.
|
|
||||||
-- Warning: The initial value can be defined seting the symbol
|
|
||||||
-- CSF_USE_ARRAY_OF_PRIMITIVES to "Yes" or "No"
|
|
||||||
|
|
||||||
IsValid( me:mutable )
|
IsValid( me:mutable )
|
||||||
returns Boolean from Standard;
|
returns Boolean from Standard;
|
||||||
---Level: Public
|
---Level: Public
|
||||||
|
@ -36,9 +36,10 @@ Graphic3d_ArrayOfPrimitives :: Graphic3d_ArrayOfPrimitives (
|
|||||||
const Standard_Boolean hasVColors,
|
const Standard_Boolean hasVColors,
|
||||||
const Standard_Boolean hasFColors,
|
const Standard_Boolean hasFColors,
|
||||||
const Standard_Boolean hasVTexels,
|
const Standard_Boolean hasVTexels,
|
||||||
const Standard_Boolean hasEdgeInfos
|
const Standard_Boolean hasEdgeInfos )
|
||||||
) : myMaxBounds(0),myMaxVertexs(0),myMaxEdges(0) {
|
: myMaxBounds(0),myMaxVertexs(0),myMaxEdges(0)
|
||||||
Standard_Integer size = sizeof(CALL_DEF_PARRAY);
|
{
|
||||||
|
const Standard_Integer size = sizeof(CALL_DEF_PARRAY);
|
||||||
Standard_Integer format = MVERTICE;
|
Standard_Integer format = MVERTICE;
|
||||||
if( hasVNormals ) format |= MVNORMAL;
|
if( hasVNormals ) format |= MVNORMAL;
|
||||||
if( hasVColors ) format |= MVCOLOR;
|
if( hasVColors ) format |= MVCOLOR;
|
||||||
@ -98,7 +99,8 @@ Graphic3d_ArrayOfPrimitives :: Graphic3d_ArrayOfPrimitives (
|
|||||||
myPrimitiveArray->num_edges = 0;
|
myPrimitiveArray->num_edges = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_ArrayOfPrimitives::Destroy ( ){
|
void Graphic3d_ArrayOfPrimitives::Destroy ()
|
||||||
|
{
|
||||||
if( myPrimitiveArray ) {
|
if( myPrimitiveArray ) {
|
||||||
if( myPrimitiveArray->vertices ){
|
if( myPrimitiveArray->vertices ){
|
||||||
Standard::Free( (Standard_Address&)myPrimitiveArray->vertices );
|
Standard::Free( (Standard_Address&)myPrimitiveArray->vertices );
|
||||||
@ -147,167 +149,86 @@ void Graphic3d_ArrayOfPrimitives::Destroy ( ){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_ArrayOfPrimitives::Enable() {
|
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z)
|
||||||
///
|
{
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_ArrayOfPrimitives::Disable() {
|
|
||||||
///
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Boolean Graphic3d_ArrayOfPrimitives::IsEnable() {
|
|
||||||
return Standard_True;
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
|
||||||
const gp_Pnt& aVertice) {
|
|
||||||
Standard_Real x,y,z;
|
|
||||||
aVertice.Coord(x,y,z);
|
|
||||||
return AddVertex(x,y,z);
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
|
||||||
const Standard_Real X, const Standard_Real Y, const Standard_Real Z) {
|
|
||||||
|
|
||||||
if( !myPrimitiveArray ) return 0;
|
if( !myPrimitiveArray ) return 0;
|
||||||
|
const Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
|
||||||
Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
|
|
||||||
if( index > myMaxVertexs ) {
|
|
||||||
Standard_OutOfRange::Raise(" TOO many VERTEX");
|
|
||||||
}
|
|
||||||
SetVertice(index,X,Y,Z);
|
SetVertice(index,X,Y,Z);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice, const Quantity_Color& aColor)
|
||||||
const gp_Pnt& aVertice,
|
{
|
||||||
const Quantity_Color& aColor) {
|
const Standard_Integer index = AddVertex(aVertice);
|
||||||
Standard_Real x,y,z;
|
|
||||||
aVertice.Coord(x,y,z);
|
|
||||||
Standard_Integer index = AddVertex(x,y,z);
|
|
||||||
Standard_Real r,g,b;
|
|
||||||
aColor.Values(r,g,b,Quantity_TOC_RGB);
|
|
||||||
SetVertexColor(index,r,g,b);
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
|
||||||
const gp_Pnt& aVertice,
|
|
||||||
const Standard_Integer aColor) {
|
|
||||||
Standard_Real x,y,z;
|
|
||||||
aVertice.Coord(x,y,z);
|
|
||||||
Standard_Integer index = AddVertex(x,y,z);
|
|
||||||
SetVertexColor(index,aColor);
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
|
||||||
const gp_Pnt& aVertice,
|
|
||||||
const gp_Dir& aNormal) {
|
|
||||||
Standard_Real x,y,z;
|
|
||||||
aVertice.Coord(x,y,z);
|
|
||||||
Standard_Real nx,ny,nz;
|
|
||||||
aNormal.Coord(nx,ny,nz);
|
|
||||||
return AddVertex(x,y,z,nx,ny,nz);
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
|
||||||
const Standard_Real X, const Standard_Real Y, const Standard_Real Z,
|
|
||||||
const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ) {
|
|
||||||
if( !myPrimitiveArray ) return 0;
|
|
||||||
|
|
||||||
Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
|
|
||||||
if( index > myMaxVertexs ) {
|
|
||||||
Standard_OutOfRange::Raise(" TOO many VERTEX");
|
|
||||||
}
|
|
||||||
SetVertice(index,X,Y,Z);
|
|
||||||
SetVertexNormal(index,NX,NY,NZ);
|
|
||||||
return index;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
|
||||||
const gp_Pnt& aVertice,
|
|
||||||
const gp_Dir& aNormal,
|
|
||||||
const Quantity_Color& aColor) {
|
|
||||||
Standard_Real x,y,z;
|
|
||||||
aVertice.Coord(x,y,z);
|
|
||||||
Standard_Real nx,ny,nz;
|
|
||||||
aNormal.Coord(nx,ny,nz);
|
|
||||||
Standard_Integer index = AddVertex(x,y,z,nx,ny,nz);
|
|
||||||
Standard_Real r,g,b;
|
Standard_Real r,g,b;
|
||||||
aColor.Values(r,g,b,Quantity_TOC_RGB);
|
aColor.Values(r,g,b,Quantity_TOC_RGB);
|
||||||
SetVertexColor(index,r,g,b);
|
SetVertexColor(index,r,g,b);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice, const Standard_Integer aColor)
|
||||||
const gp_Pnt& aVertice,
|
{
|
||||||
|
const Standard_Integer index = AddVertex(aVertice);
|
||||||
|
SetVertexColor(index,aColor);
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z,
|
||||||
|
const Standard_ShortReal NX, const Standard_ShortReal NY, const Standard_ShortReal NZ)
|
||||||
|
{
|
||||||
|
if( !myPrimitiveArray ) return 0;
|
||||||
|
const Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
|
||||||
|
SetVertice(index,X,Y,Z);
|
||||||
|
SetVertexNormal(index,NX,NY,NZ);
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice,
|
||||||
const gp_Dir& aNormal,
|
const gp_Dir& aNormal,
|
||||||
const Standard_Integer aColor) {
|
const Quantity_Color& aColor)
|
||||||
Standard_Real x,y,z;
|
{
|
||||||
aVertice.Coord(x,y,z);
|
const Standard_Integer index = AddVertex(aVertice,aNormal);
|
||||||
Standard_Real nx,ny,nz;
|
Standard_Real r,g,b;
|
||||||
aNormal.Coord(nx,ny,nz);
|
aColor.Values(r,g,b,Quantity_TOC_RGB);
|
||||||
Standard_Integer index = AddVertex(x,y,z,nx,ny,nz);
|
SetVertexColor(index,r,g,b);
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice,
|
||||||
|
const gp_Dir& aNormal,
|
||||||
|
const Standard_Integer aColor)
|
||||||
|
{
|
||||||
|
const Standard_Integer index = AddVertex(aVertice,aNormal);
|
||||||
SetVertexColor(index,aColor);
|
SetVertexColor(index,aColor);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
||||||
const gp_Pnt& aVertice,
|
const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z,
|
||||||
const gp_Pnt2d& aTexel) {
|
const Standard_ShortReal TX, const Standard_ShortReal TY)
|
||||||
Standard_Real x,y,z;
|
{
|
||||||
aVertice.Coord(x,y,z);
|
|
||||||
Standard_Real tx,ty;
|
|
||||||
aTexel.Coord(tx,ty);
|
|
||||||
return AddVertex(x,y,z,tx,ty);
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
|
||||||
const Standard_Real X, const Standard_Real Y, const Standard_Real Z,
|
|
||||||
const Standard_Real TX, const Standard_Real TY) {
|
|
||||||
if( !myPrimitiveArray ) return 0;
|
if( !myPrimitiveArray ) return 0;
|
||||||
|
const Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
|
||||||
Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
|
|
||||||
if( index > myMaxVertexs ) {
|
|
||||||
Standard_OutOfRange::Raise(" TOO many VERTEX");
|
|
||||||
}
|
|
||||||
SetVertice(index,X,Y,Z);
|
SetVertice(index,X,Y,Z);
|
||||||
SetVertexTexel(index,TX,TY);
|
SetVertexTexel(index,TX,TY);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
||||||
const gp_Pnt& aVertice,
|
const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z,
|
||||||
const gp_Dir& aNormal,
|
const Standard_ShortReal NX, const Standard_ShortReal NY, const Standard_ShortReal NZ,
|
||||||
const gp_Pnt2d& aTexel) {
|
const Standard_ShortReal TX, const Standard_ShortReal TY)
|
||||||
Standard_Real x,y,z;
|
{
|
||||||
aVertice.Coord(x,y,z);
|
|
||||||
Standard_Real nx,ny,nz;
|
|
||||||
aNormal.Coord(nx,ny,nz);
|
|
||||||
Standard_Real tx,ty;
|
|
||||||
aTexel.Coord(tx,ty);
|
|
||||||
return AddVertex(x,y,z,nx,ny,nz,tx,ty);
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
|
||||||
const Standard_Real X, const Standard_Real Y, const Standard_Real Z,
|
|
||||||
const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ,
|
|
||||||
const Standard_Real TX, const Standard_Real TY) {
|
|
||||||
if( !myPrimitiveArray ) return 0;
|
if( !myPrimitiveArray ) return 0;
|
||||||
|
const Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
|
||||||
Standard_Integer index = myPrimitiveArray->num_vertexs + 1;
|
|
||||||
if( index > myMaxVertexs ) {
|
|
||||||
Standard_OutOfRange::Raise(" TOO many VERTEX");
|
|
||||||
}
|
|
||||||
SetVertice(index,X,Y,Z);
|
SetVertice(index,X,Y,Z);
|
||||||
SetVertexNormal(index,NX,NY,NZ);
|
SetVertexNormal(index,NX,NY,NZ);
|
||||||
SetVertexTexel(index,TX,TY);
|
SetVertexTexel(index,TX,TY);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound( const Standard_Integer edgeNumber) {
|
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound( const Standard_Integer edgeNumber)
|
||||||
|
{
|
||||||
Standard_Integer index = 0;
|
Standard_Integer index = 0;
|
||||||
if( myPrimitiveArray && myPrimitiveArray->bounds ) {
|
if( myPrimitiveArray && myPrimitiveArray->bounds ) {
|
||||||
index = myPrimitiveArray->num_bounds;
|
index = myPrimitiveArray->num_bounds;
|
||||||
@ -322,22 +243,20 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound( const Standard_Integer e
|
|||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound(
|
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound( const Standard_Integer edgeNumber,
|
||||||
const Standard_Integer edgeNumber,
|
const Quantity_Color& aFColor)
|
||||||
const Quantity_Color& aFColor
|
{
|
||||||
) {
|
|
||||||
Standard_Real r,g,b;
|
Standard_Real r,g,b;
|
||||||
aFColor.Values(r,g,b,Quantity_TOC_RGB);
|
aFColor.Values(r,g,b,Quantity_TOC_RGB);
|
||||||
return AddBound(edgeNumber,r,g,b);
|
return AddBound(edgeNumber,r,g,b);
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound(
|
Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound( const Standard_Integer edgeNumber,
|
||||||
const Standard_Integer edgeNumber,
|
|
||||||
const Standard_Real R,
|
const Standard_Real R,
|
||||||
const Standard_Real G,
|
const Standard_Real G,
|
||||||
const Standard_Real B) {
|
const Standard_Real B)
|
||||||
|
{
|
||||||
if( !myPrimitiveArray ) return 0;
|
if( !myPrimitiveArray ) return 0;
|
||||||
|
|
||||||
Standard_Integer index = myPrimitiveArray->num_bounds;
|
Standard_Integer index = myPrimitiveArray->num_bounds;
|
||||||
if( index >= myMaxBounds ) {
|
if( index >= myMaxBounds ) {
|
||||||
Standard_OutOfRange::Raise(" TOO many BOUND");
|
Standard_OutOfRange::Raise(" TOO many BOUND");
|
||||||
@ -348,9 +267,9 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddBound(
|
|||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge(
|
Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge(const Standard_Integer vertexIndex,
|
||||||
const Standard_Integer vertexIndex,
|
const Standard_Boolean isVisible)
|
||||||
const Standard_Boolean isVisible) {
|
{
|
||||||
if( !myPrimitiveArray ) return 0;
|
if( !myPrimitiveArray ) return 0;
|
||||||
|
|
||||||
Standard_Integer index = myPrimitiveArray->num_edges;
|
Standard_Integer index = myPrimitiveArray->num_edges;
|
||||||
@ -371,15 +290,15 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::AddEdge(
|
|||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(
|
Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(const gp_Dir& aNormal)
|
||||||
const gp_Dir& aNormal) {
|
{
|
||||||
return Orientate(1,Max(VertexNumber(),EdgeNumber()),aNormal);
|
return Orientate(1,Max(VertexNumber(),EdgeNumber()),aNormal);
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(
|
Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(const Standard_Integer aVertexIndex,
|
||||||
const Standard_Integer aVertexIndex,
|
|
||||||
const Standard_Integer aVertexNumber,
|
const Standard_Integer aVertexNumber,
|
||||||
const gp_Dir& aNormal) {
|
const gp_Dir& aNormal)
|
||||||
|
{
|
||||||
Standard_Boolean somethingHasChange = Standard_False;
|
Standard_Boolean somethingHasChange = Standard_False;
|
||||||
if( myPrimitiveArray && (myPrimitiveArray->num_vertexs > 2) ) {
|
if( myPrimitiveArray && (myPrimitiveArray->num_vertexs > 2) ) {
|
||||||
Standard_Integer i,j,k=aVertexNumber,n=aVertexIndex-1;
|
Standard_Integer i,j,k=aVertexNumber,n=aVertexIndex-1;
|
||||||
@ -495,9 +414,9 @@ Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(
|
|||||||
return somethingHasChange;
|
return somethingHasChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(
|
Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(const Standard_Integer aBoundIndex,
|
||||||
const Standard_Integer aBoundIndex,
|
const gp_Dir& aNormal)
|
||||||
const gp_Dir& aNormal) {
|
{
|
||||||
Standard_Boolean somethingHasChange = Standard_False;
|
Standard_Boolean somethingHasChange = Standard_False;
|
||||||
if( myPrimitiveArray && myPrimitiveArray->vertices ) {
|
if( myPrimitiveArray && myPrimitiveArray->vertices ) {
|
||||||
if( myPrimitiveArray->bounds &&
|
if( myPrimitiveArray->bounds &&
|
||||||
@ -537,26 +456,25 @@ Standard_Boolean Graphic3d_ArrayOfPrimitives::Orientate(
|
|||||||
return somethingHasChange;
|
return somethingHasChange;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_ArrayOfPrimitives::SetVertice(
|
void Graphic3d_ArrayOfPrimitives::SetVertice( const Standard_Integer anIndex,
|
||||||
const Standard_Integer anIndex,
|
const gp_Pnt& aVertice)
|
||||||
const gp_Pnt& aVertice) {
|
{
|
||||||
Standard_Real x,y,z;
|
Standard_Real x,y,z;
|
||||||
aVertice.Coord(x,y,z);
|
aVertice.Coord(x,y,z);
|
||||||
SetVertice(anIndex,x,y,z);
|
SetVertice(anIndex,Standard_ShortReal(x),Standard_ShortReal(y),Standard_ShortReal(z));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_ArrayOfPrimitives::SetVertexColor(
|
void Graphic3d_ArrayOfPrimitives::SetVertexColor( const Standard_Integer anIndex,
|
||||||
const Standard_Integer anIndex,
|
const Quantity_Color& aColor)
|
||||||
const Quantity_Color& aColor) {
|
{
|
||||||
Standard_Real r,g,b;
|
Standard_Real r,g,b;
|
||||||
aColor.Values(r,g,b,Quantity_TOC_RGB);
|
aColor.Values(r,g,b,Quantity_TOC_RGB);
|
||||||
SetVertexColor(anIndex,r,g,b);
|
SetVertexColor(anIndex,r,g,b);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_ArrayOfPrimitives::SetVertexColor(
|
void Graphic3d_ArrayOfPrimitives::SetVertexColor( const Standard_Integer anIndex,
|
||||||
const Standard_Integer anIndex,
|
const Standard_Integer aColor)
|
||||||
const Standard_Integer aColor) {
|
{
|
||||||
|
|
||||||
if( !myPrimitiveArray ) return;
|
if( !myPrimitiveArray ) return;
|
||||||
if( anIndex < 1 || anIndex > myMaxVertexs ) {
|
if( anIndex < 1 || anIndex > myMaxVertexs ) {
|
||||||
Standard_OutOfRange::Raise(" BAD VERTEX index");
|
Standard_OutOfRange::Raise(" BAD VERTEX index");
|
||||||
@ -580,31 +498,33 @@ void Graphic3d_ArrayOfPrimitives::SetVertexColor(
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Graphic3d_ArrayOfPrimitives::SetVertexNormal(
|
|
||||||
const Standard_Integer anIndex,
|
void Graphic3d_ArrayOfPrimitives::SetVertexNormal(const Standard_Integer anIndex,
|
||||||
const gp_Dir& aNormal) {
|
const gp_Dir& aNormal)
|
||||||
|
{
|
||||||
Standard_Real x,y,z;
|
Standard_Real x,y,z;
|
||||||
aNormal.Coord(x,y,z);
|
aNormal.Coord(x,y,z);
|
||||||
SetVertexNormal(anIndex,x,y,z);
|
SetVertexNormal(anIndex,x,y,z);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_ArrayOfPrimitives::SetVertexTexel(
|
void Graphic3d_ArrayOfPrimitives::SetVertexTexel( const Standard_Integer anIndex,
|
||||||
const Standard_Integer anIndex,
|
const gp_Pnt2d& aTexel)
|
||||||
const gp_Pnt2d& aTexel) {
|
{
|
||||||
Standard_Real x,y;
|
Standard_Real x,y;
|
||||||
aTexel.Coord(x,y);
|
aTexel.Coord(x,y);
|
||||||
SetVertexTexel(anIndex,x,y);
|
SetVertexTexel(anIndex,x,y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_ArrayOfPrimitives::SetBoundColor(
|
void Graphic3d_ArrayOfPrimitives::SetBoundColor(const Standard_Integer anIndex,
|
||||||
const Standard_Integer anIndex,
|
const Quantity_Color& aColor)
|
||||||
const Quantity_Color& aColor) {
|
{
|
||||||
Standard_Real r,g,b;
|
Standard_Real r,g,b;
|
||||||
aColor.Values(r,g,b,Quantity_TOC_RGB);
|
aColor.Values(r,g,b,Quantity_TOC_RGB);
|
||||||
SetBoundColor(anIndex,r,g,b);
|
SetBoundColor(anIndex,r,g,b);
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const {
|
Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const
|
||||||
|
{
|
||||||
TCollection_AsciiString name("UndefinedArray");
|
TCollection_AsciiString name("UndefinedArray");
|
||||||
switch( myPrimitiveArray->type ) {
|
switch( myPrimitiveArray->type ) {
|
||||||
case TelPointsArrayType:
|
case TelPointsArrayType:
|
||||||
@ -641,37 +561,43 @@ Standard_CString Graphic3d_ArrayOfPrimitives::StringType() const {
|
|||||||
return name.ToCString();
|
return name.ToCString();
|
||||||
}
|
}
|
||||||
|
|
||||||
gp_Pnt Graphic3d_ArrayOfPrimitives::Vertice(const Standard_Integer aRank) const {
|
gp_Pnt Graphic3d_ArrayOfPrimitives::Vertice(const Standard_Integer aRank) const
|
||||||
|
{
|
||||||
Standard_Real x,y,z;
|
Standard_Real x,y,z;
|
||||||
Vertice(aRank,x,y,z);
|
Vertice(aRank,x,y,z);
|
||||||
return gp_Pnt(x,y,z);
|
return gp_Pnt(x,y,z);
|
||||||
}
|
}
|
||||||
|
|
||||||
Quantity_Color Graphic3d_ArrayOfPrimitives::VertexColor(const Standard_Integer aRank) const {
|
Quantity_Color Graphic3d_ArrayOfPrimitives::VertexColor(const Standard_Integer aRank) const
|
||||||
|
{
|
||||||
Standard_Real r,g,b;
|
Standard_Real r,g,b;
|
||||||
VertexColor(aRank,r,g,b);
|
VertexColor(aRank,r,g,b);
|
||||||
return Quantity_Color(r,g,b,Quantity_TOC_RGB);
|
return Quantity_Color(r,g,b,Quantity_TOC_RGB);
|
||||||
}
|
}
|
||||||
|
|
||||||
gp_Dir Graphic3d_ArrayOfPrimitives::VertexNormal(const Standard_Integer aRank) const {
|
gp_Dir Graphic3d_ArrayOfPrimitives::VertexNormal(const Standard_Integer aRank) const
|
||||||
|
{
|
||||||
Standard_Real x,y,z;
|
Standard_Real x,y,z;
|
||||||
VertexNormal(aRank,x,y,z);
|
VertexNormal(aRank,x,y,z);
|
||||||
return gp_Dir(x,y,z);
|
return gp_Dir(x,y,z);
|
||||||
}
|
}
|
||||||
|
|
||||||
gp_Pnt2d Graphic3d_ArrayOfPrimitives::VertexTexel(const Standard_Integer aRank) const {
|
gp_Pnt2d Graphic3d_ArrayOfPrimitives::VertexTexel(const Standard_Integer aRank) const
|
||||||
|
{
|
||||||
Standard_Real x,y;
|
Standard_Real x,y;
|
||||||
VertexTexel(aRank,x,y);
|
VertexTexel(aRank,x,y);
|
||||||
return gp_Pnt2d(x,y);
|
return gp_Pnt2d(x,y);
|
||||||
}
|
}
|
||||||
|
|
||||||
Quantity_Color Graphic3d_ArrayOfPrimitives::BoundColor(const Standard_Integer aRank) const {
|
Quantity_Color Graphic3d_ArrayOfPrimitives::BoundColor(const Standard_Integer aRank) const
|
||||||
|
{
|
||||||
Standard_Real r,g,b;
|
Standard_Real r,g,b;
|
||||||
BoundColor(aRank,r,g,b);
|
BoundColor(aRank,r,g,b);
|
||||||
return Quantity_Color(r,g,b,Quantity_TOC_RGB);
|
return Quantity_Color(r,g,b,Quantity_TOC_RGB);
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const {
|
Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const
|
||||||
|
{
|
||||||
Standard_Integer number=-1;
|
Standard_Integer number=-1;
|
||||||
if( myPrimitiveArray ) switch( myPrimitiveArray->type ) {
|
if( myPrimitiveArray ) switch( myPrimitiveArray->type ) {
|
||||||
case TelPointsArrayType:
|
case TelPointsArrayType:
|
||||||
@ -720,9 +646,9 @@ Standard_Integer Graphic3d_ArrayOfPrimitives::ItemNumber() const {
|
|||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_ArrayOfPrimitives::ComputeVNormals(
|
void Graphic3d_ArrayOfPrimitives::ComputeVNormals(const Standard_Integer from,
|
||||||
const Standard_Integer from,
|
const Standard_Integer to)
|
||||||
const Standard_Integer to) {
|
{
|
||||||
Standard_Integer next = from+1;
|
Standard_Integer next = from+1;
|
||||||
Standard_Integer last = to+1;
|
Standard_Integer last = to+1;
|
||||||
gp_Pnt p1,p2,p3;
|
gp_Pnt p1,p2,p3;
|
||||||
@ -769,8 +695,8 @@ void Graphic3d_ArrayOfPrimitives::ComputeVNormals(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean Graphic3d_ArrayOfPrimitives::IsValid() {
|
Standard_Boolean Graphic3d_ArrayOfPrimitives::IsValid()
|
||||||
|
{
|
||||||
if( !myPrimitiveArray ) return Standard_False;
|
if( !myPrimitiveArray ) return Standard_False;
|
||||||
|
|
||||||
Standard_Integer nvertexs = myPrimitiveArray->num_vertexs;
|
Standard_Integer nvertexs = myPrimitiveArray->num_vertexs;
|
||||||
|
@ -23,84 +23,139 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
inline Graphic3d_PrimitiveArray Graphic3d_ArrayOfPrimitives::Array() const {
|
#include <gp_Dir.hxx>
|
||||||
|
#include <gp_Pnt.hxx>
|
||||||
|
|
||||||
|
inline Graphic3d_PrimitiveArray Graphic3d_ArrayOfPrimitives::Array() const
|
||||||
|
{
|
||||||
return myPrimitiveArray;
|
return myPrimitiveArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Graphic3d_TypeOfPrimitiveArray Graphic3d_ArrayOfPrimitives::Type() const {
|
inline Graphic3d_TypeOfPrimitiveArray Graphic3d_ArrayOfPrimitives::Type() const
|
||||||
|
{
|
||||||
Graphic3d_TypeOfPrimitiveArray type = Graphic3d_TOPA_UNDEFINED;
|
Graphic3d_TypeOfPrimitiveArray type = Graphic3d_TOPA_UNDEFINED;
|
||||||
if( myPrimitiveArray ) type = (Graphic3d_TypeOfPrimitiveArray) myPrimitiveArray->type;
|
if( myPrimitiveArray ) type = (Graphic3d_TypeOfPrimitiveArray) myPrimitiveArray->type;
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexNormals() const {
|
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexNormals() const
|
||||||
|
{
|
||||||
Standard_Boolean defined = Standard_False;
|
Standard_Boolean defined = Standard_False;
|
||||||
if( myPrimitiveArray && myPrimitiveArray->vnormals ) defined = Standard_True;
|
if( myPrimitiveArray && myPrimitiveArray->vnormals ) defined = Standard_True;
|
||||||
return defined;
|
return defined;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexColors() const {
|
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexColors() const
|
||||||
|
{
|
||||||
Standard_Boolean defined = Standard_False;
|
Standard_Boolean defined = Standard_False;
|
||||||
if( myPrimitiveArray && myPrimitiveArray->vcolours ) defined = Standard_True;
|
if( myPrimitiveArray && myPrimitiveArray->vcolours ) defined = Standard_True;
|
||||||
return defined;
|
return defined;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexTexels() const {
|
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasVertexTexels() const
|
||||||
|
{
|
||||||
Standard_Boolean defined = Standard_False;
|
Standard_Boolean defined = Standard_False;
|
||||||
if( myPrimitiveArray && myPrimitiveArray->vtexels ) defined = Standard_True;
|
if( myPrimitiveArray && myPrimitiveArray->vtexels ) defined = Standard_True;
|
||||||
return defined;
|
return defined;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasEdgeInfos() const {
|
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasEdgeInfos() const
|
||||||
|
{
|
||||||
Standard_Boolean defined = Standard_False;
|
Standard_Boolean defined = Standard_False;
|
||||||
if( myPrimitiveArray && myPrimitiveArray->edge_vis ) defined = Standard_True;
|
if( myPrimitiveArray && myPrimitiveArray->edge_vis ) defined = Standard_True;
|
||||||
return defined;
|
return defined;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Standard_Integer Graphic3d_ArrayOfPrimitives::VertexNumber() const {
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::VertexNumber() const
|
||||||
|
{
|
||||||
Standard_Integer number = -1;
|
Standard_Integer number = -1;
|
||||||
if( myPrimitiveArray ) number = myPrimitiveArray->num_vertexs;
|
if( myPrimitiveArray ) number = myPrimitiveArray->num_vertexs;
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice)
|
||||||
|
{
|
||||||
|
return AddVertex(aVertice.X(),aVertice.Y(),aVertice.Z());
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
||||||
|
const Standard_Real X, const Standard_Real Y, const Standard_Real Z)
|
||||||
|
{
|
||||||
|
return AddVertex(Standard_ShortReal(X),Standard_ShortReal(Y),Standard_ShortReal(Z));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice, const gp_Dir& aNormal)
|
||||||
|
{
|
||||||
|
return AddVertex(aVertice.X(),aVertice.Y(),aVertice.Z(),aNormal.X(),aNormal.Y(),aNormal.Z());
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
||||||
|
const Standard_Real X, const Standard_Real Y, const Standard_Real Z,
|
||||||
|
const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ)
|
||||||
|
{
|
||||||
|
return AddVertex(Standard_ShortReal(X),Standard_ShortReal(Y),Standard_ShortReal(Z),
|
||||||
|
Standard_ShortReal(NX),Standard_ShortReal(NY),Standard_ShortReal(NZ));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice, const gp_Pnt2d& aTexel)
|
||||||
|
{
|
||||||
|
return AddVertex(aVertice.X(),aVertice.Y(),aVertice.Z(),aTexel.X(),aTexel.Y());
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
||||||
|
const Standard_Real X, const Standard_Real Y, const Standard_Real Z,
|
||||||
|
const Standard_Real TX, const Standard_Real TY)
|
||||||
|
{
|
||||||
|
return AddVertex(Standard_ShortReal(X),Standard_ShortReal(Y),Standard_ShortReal(Z),
|
||||||
|
Standard_ShortReal(TX),Standard_ShortReal(TY));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(const gp_Pnt& aVertice, const gp_Dir& aNormal, const gp_Pnt2d& aTexel)
|
||||||
|
{
|
||||||
|
return AddVertex(aVertice.X(),aVertice.Y(),aVertice.Z(),aNormal.X(),aNormal.Y(),aNormal.Z(),aTexel.X(),aTexel.Y());
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::AddVertex(
|
||||||
|
const Standard_Real X, const Standard_Real Y, const Standard_Real Z,
|
||||||
|
const Standard_Real NX, const Standard_Real NY, const Standard_Real NZ,
|
||||||
|
const Standard_Real TX, const Standard_Real TY)
|
||||||
|
{
|
||||||
|
return AddVertex(Standard_ShortReal(X),Standard_ShortReal(Y),Standard_ShortReal(Z),
|
||||||
|
Standard_ShortReal(NX),Standard_ShortReal(NY),Standard_ShortReal(NZ),
|
||||||
|
Standard_ShortReal(TX),Standard_ShortReal(TY));
|
||||||
|
}
|
||||||
|
|
||||||
inline void Graphic3d_ArrayOfPrimitives::SetVertice(
|
inline void Graphic3d_ArrayOfPrimitives::SetVertice(
|
||||||
const Standard_Integer anIndex,
|
const Standard_Integer anIndex,
|
||||||
const Standard_Real X, const Standard_Real Y, const Standard_Real Z) {
|
const Standard_ShortReal X, const Standard_ShortReal Y, const Standard_ShortReal Z)
|
||||||
|
{
|
||||||
if( !myPrimitiveArray ) return;
|
if( !myPrimitiveArray ) return;
|
||||||
if( anIndex < 1 || anIndex > myMaxVertexs ) {
|
if( anIndex < 1 || anIndex > myMaxVertexs )
|
||||||
Standard_OutOfRange::Raise(" BAD VERTEX index");
|
Standard_OutOfRange::Raise(" BAD VERTEX index");
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Integer index = anIndex-1;
|
if( myPrimitiveArray->vertices ) {
|
||||||
{
|
Tfloat *p = myPrimitiveArray->vertices[anIndex-1].xyz;
|
||||||
if( myPrimitiveArray->vertices ) {
|
*p++ = X;
|
||||||
Tfloat *p = myPrimitiveArray->vertices[index].xyz;
|
*p++ = Y;
|
||||||
*p++ = Standard_ShortReal(X);
|
*p = Z;
|
||||||
*p++ = Standard_ShortReal(Y);
|
|
||||||
*p = Standard_ShortReal(Z);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
myPrimitiveArray->num_vertexs = Max(anIndex,myPrimitiveArray->num_vertexs);
|
myPrimitiveArray->num_vertexs = Max(anIndex,myPrimitiveArray->num_vertexs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void Graphic3d_ArrayOfPrimitives::SetVertexColor(const Standard_Integer anIndex,
|
||||||
inline void Graphic3d_ArrayOfPrimitives::SetVertexColor(
|
|
||||||
const Standard_Integer anIndex,
|
|
||||||
const Standard_Real R,
|
const Standard_Real R,
|
||||||
const Standard_Real G,
|
const Standard_Real G,
|
||||||
const Standard_Real B) {
|
const Standard_Real B)
|
||||||
|
{
|
||||||
if( !myPrimitiveArray ) return;
|
if( !myPrimitiveArray ) return;
|
||||||
if( anIndex < 1 || anIndex > myMaxVertexs ) {
|
if( anIndex < 1 || anIndex > myMaxVertexs ) {
|
||||||
Standard_OutOfRange::Raise(" BAD VERTEX index");
|
Standard_OutOfRange::Raise(" BAD VERTEX index");
|
||||||
}
|
}
|
||||||
|
|
||||||
if( myPrimitiveArray->vcolours ) {
|
if( myPrimitiveArray->vcolours ) {
|
||||||
unsigned char red = (unsigned char)(R <= 0. ? 0. : R >= 1. ? 255. : R * 255.);
|
unsigned char red = (unsigned int)(R * 255.);
|
||||||
unsigned char green = (unsigned char)(G <= 0. ? 0. : G >= 1. ? 255. : G * 255.);
|
unsigned char green = (unsigned int)(G * 255.);
|
||||||
unsigned char blue = (unsigned char)(B <= 0. ? 0. : B >= 1. ? 255. : B * 255.);
|
unsigned char blue = (unsigned int)(B * 255.);
|
||||||
unsigned char alpha = 0;
|
unsigned char alpha = 0;
|
||||||
Standard_Integer outColor ;
|
Standard_Integer outColor ;
|
||||||
outColor = red;
|
outColor = red;
|
||||||
@ -136,7 +191,8 @@ inline void Graphic3d_ArrayOfPrimitives::SetVertexNormal(
|
|||||||
|
|
||||||
inline void Graphic3d_ArrayOfPrimitives::SetVertexTexel(
|
inline void Graphic3d_ArrayOfPrimitives::SetVertexTexel(
|
||||||
const Standard_Integer anIndex,
|
const Standard_Integer anIndex,
|
||||||
const Standard_Real TX, const Standard_Real TY) {
|
const Standard_Real TX, const Standard_Real TY)
|
||||||
|
{
|
||||||
if( !myPrimitiveArray ) return;
|
if( !myPrimitiveArray ) return;
|
||||||
if( anIndex < 1 || anIndex > myMaxVertexs ) {
|
if( anIndex < 1 || anIndex > myMaxVertexs ) {
|
||||||
Standard_OutOfRange::Raise(" BAD VERTEX index");
|
Standard_OutOfRange::Raise(" BAD VERTEX index");
|
||||||
@ -153,7 +209,8 @@ inline void Graphic3d_ArrayOfPrimitives::SetVertexTexel(
|
|||||||
|
|
||||||
inline void Graphic3d_ArrayOfPrimitives::SetBoundColor(
|
inline void Graphic3d_ArrayOfPrimitives::SetBoundColor(
|
||||||
const Standard_Integer anIndex,
|
const Standard_Integer anIndex,
|
||||||
const Standard_Real R, const Standard_Real G, const Standard_Real B) {
|
const Standard_Real R, const Standard_Real G, const Standard_Real B)
|
||||||
|
{
|
||||||
if( !myPrimitiveArray ) return;
|
if( !myPrimitiveArray ) return;
|
||||||
if( anIndex < 1 || anIndex > myMaxBounds ) {
|
if( anIndex < 1 || anIndex > myMaxBounds ) {
|
||||||
Standard_OutOfRange::Raise(" BAD BOUND index");
|
Standard_OutOfRange::Raise(" BAD BOUND index");
|
||||||
@ -169,7 +226,8 @@ inline void Graphic3d_ArrayOfPrimitives::SetBoundColor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void Graphic3d_ArrayOfPrimitives::Vertice(const Standard_Integer anIndex,
|
inline void Graphic3d_ArrayOfPrimitives::Vertice(const Standard_Integer anIndex,
|
||||||
Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const {
|
Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const
|
||||||
|
{
|
||||||
X = Y = Z = 0.;
|
X = Y = Z = 0.;
|
||||||
if( !myPrimitiveArray ) return;
|
if( !myPrimitiveArray ) return;
|
||||||
if( anIndex < 1 || anIndex > myPrimitiveArray->num_vertexs ) {
|
if( anIndex < 1 || anIndex > myPrimitiveArray->num_vertexs ) {
|
||||||
@ -184,7 +242,8 @@ inline void Graphic3d_ArrayOfPrimitives::Vertice(const Standard_Integer anIndex,
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void Graphic3d_ArrayOfPrimitives::VertexColor(const Standard_Integer anIndex,
|
inline void Graphic3d_ArrayOfPrimitives::VertexColor(const Standard_Integer anIndex,
|
||||||
Standard_Real& R, Standard_Real& G, Standard_Real& B) const {
|
Standard_Real& R, Standard_Real& G, Standard_Real& B) const
|
||||||
|
{
|
||||||
R = G = B = 0;
|
R = G = B = 0;
|
||||||
if( !myPrimitiveArray ) return;
|
if( !myPrimitiveArray ) return;
|
||||||
if( anIndex < 1 || anIndex > myPrimitiveArray->num_vertexs ) {
|
if( anIndex < 1 || anIndex > myPrimitiveArray->num_vertexs ) {
|
||||||
@ -234,9 +293,9 @@ inline void Graphic3d_ArrayOfPrimitives::VertexColor(const Standard_Integer anIn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline void Graphic3d_ArrayOfPrimitives::VertexNormal(const Standard_Integer anIndex,
|
inline void Graphic3d_ArrayOfPrimitives::VertexNormal(const Standard_Integer anIndex,
|
||||||
Standard_Real& NX, Standard_Real& NY, Standard_Real& NZ) const {
|
Standard_Real& NX, Standard_Real& NY, Standard_Real& NZ) const
|
||||||
|
{
|
||||||
NX = NY = NZ = 0.;
|
NX = NY = NZ = 0.;
|
||||||
if( !myPrimitiveArray ) return;
|
if( !myPrimitiveArray ) return;
|
||||||
if( anIndex < 1 || anIndex > myPrimitiveArray->num_vertexs ) {
|
if( anIndex < 1 || anIndex > myPrimitiveArray->num_vertexs ) {
|
||||||
@ -251,7 +310,8 @@ inline void Graphic3d_ArrayOfPrimitives::VertexNormal(const Standard_Integer anI
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void Graphic3d_ArrayOfPrimitives::VertexTexel(const Standard_Integer anIndex,
|
inline void Graphic3d_ArrayOfPrimitives::VertexTexel(const Standard_Integer anIndex,
|
||||||
Standard_Real& TX, Standard_Real& TY) const {
|
Standard_Real& TX, Standard_Real& TY) const
|
||||||
|
{
|
||||||
TX = TY = 0.;
|
TX = TY = 0.;
|
||||||
if( !myPrimitiveArray ) return;
|
if( !myPrimitiveArray ) return;
|
||||||
if( anIndex < 1 || anIndex > myPrimitiveArray->num_vertexs ) {
|
if( anIndex < 1 || anIndex > myPrimitiveArray->num_vertexs ) {
|
||||||
@ -265,14 +325,15 @@ inline void Graphic3d_ArrayOfPrimitives::VertexTexel(const Standard_Integer anIn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Standard_Integer Graphic3d_ArrayOfPrimitives::EdgeNumber() const {
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::EdgeNumber() const
|
||||||
|
{
|
||||||
Standard_Integer number = -1;
|
Standard_Integer number = -1;
|
||||||
if( myPrimitiveArray ) number = myPrimitiveArray->num_edges;
|
if( myPrimitiveArray ) number = myPrimitiveArray->num_edges;
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Standard_Integer Graphic3d_ArrayOfPrimitives::Edge(
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::Edge(const Standard_Integer anIndex ) const
|
||||||
const Standard_Integer anIndex ) const {
|
{
|
||||||
Standard_Integer index=0;
|
Standard_Integer index=0;
|
||||||
if( myPrimitiveArray && myPrimitiveArray->edge_vis &&
|
if( myPrimitiveArray && myPrimitiveArray->edge_vis &&
|
||||||
(anIndex > 0) && (anIndex <= myPrimitiveArray->num_edges) ) {
|
(anIndex > 0) && (anIndex <= myPrimitiveArray->num_edges) ) {
|
||||||
@ -283,8 +344,8 @@ inline Standard_Integer Graphic3d_ArrayOfPrimitives::Edge(
|
|||||||
return index+1;
|
return index+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::EdgeIsVisible(
|
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::EdgeIsVisible(const Standard_Integer anIndex ) const
|
||||||
const Standard_Integer anIndex ) const {
|
{
|
||||||
Standard_Boolean isVisible = Standard_False;
|
Standard_Boolean isVisible = Standard_False;
|
||||||
if( myPrimitiveArray && myPrimitiveArray->edge_vis &&
|
if( myPrimitiveArray && myPrimitiveArray->edge_vis &&
|
||||||
(anIndex > 0) && (anIndex <= myPrimitiveArray->num_edges) ) {
|
(anIndex > 0) && (anIndex <= myPrimitiveArray->num_edges) ) {
|
||||||
@ -296,19 +357,22 @@ inline Standard_Boolean Graphic3d_ArrayOfPrimitives::EdgeIsVisible(
|
|||||||
return isVisible;
|
return isVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasBoundColors() const {
|
inline Standard_Boolean Graphic3d_ArrayOfPrimitives::HasBoundColors() const
|
||||||
|
{
|
||||||
Standard_Boolean defined = Standard_False;
|
Standard_Boolean defined = Standard_False;
|
||||||
if( myPrimitiveArray && myPrimitiveArray->fcolours ) defined = Standard_True;
|
if( myPrimitiveArray && myPrimitiveArray->fcolours ) defined = Standard_True;
|
||||||
return defined;
|
return defined;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Standard_Integer Graphic3d_ArrayOfPrimitives::BoundNumber() const {
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::BoundNumber() const
|
||||||
|
{
|
||||||
Standard_Integer number = -1;
|
Standard_Integer number = -1;
|
||||||
if( myPrimitiveArray ) number = myPrimitiveArray->num_bounds;
|
if( myPrimitiveArray ) number = myPrimitiveArray->num_bounds;
|
||||||
return number;
|
return number;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Standard_Integer Graphic3d_ArrayOfPrimitives::Bound(const Standard_Integer anIndex) const {
|
inline Standard_Integer Graphic3d_ArrayOfPrimitives::Bound(const Standard_Integer anIndex) const
|
||||||
|
{
|
||||||
Standard_Integer number=-1;
|
Standard_Integer number=-1;
|
||||||
if( myPrimitiveArray && myPrimitiveArray->bounds &&
|
if( myPrimitiveArray && myPrimitiveArray->bounds &&
|
||||||
(anIndex > 0) && (anIndex <= myPrimitiveArray->num_bounds) ) {
|
(anIndex > 0) && (anIndex <= myPrimitiveArray->num_bounds) ) {
|
||||||
@ -320,7 +384,8 @@ inline Standard_Integer Graphic3d_ArrayOfPrimitives::Bound(const Standard_Intege
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void Graphic3d_ArrayOfPrimitives::BoundColor(const Standard_Integer anIndex,
|
inline void Graphic3d_ArrayOfPrimitives::BoundColor(const Standard_Integer anIndex,
|
||||||
Standard_Real& R, Standard_Real& G, Standard_Real& B) const {
|
Standard_Real& R, Standard_Real& G, Standard_Real& B) const
|
||||||
|
{
|
||||||
if( myPrimitiveArray && myPrimitiveArray->fcolours &&
|
if( myPrimitiveArray && myPrimitiveArray->fcolours &&
|
||||||
(anIndex > 0) && (anIndex <= myPrimitiveArray->num_bounds) ) {
|
(anIndex > 0) && (anIndex <= myPrimitiveArray->num_bounds) ) {
|
||||||
Tfloat *p = myPrimitiveArray->fcolours[anIndex-1].rgb;
|
Tfloat *p = myPrimitiveArray->fcolours[anIndex-1].rgb;
|
||||||
|
@ -90,12 +90,8 @@ class Graphic3d_CGroup
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
int LabelBegin;
|
|
||||||
int LabelEnd;
|
|
||||||
void* ptrGroup;
|
void* ptrGroup;
|
||||||
|
|
||||||
int StructureEnd;
|
|
||||||
|
|
||||||
CALL_DEF_CONTEXTLINE ContextLine;
|
CALL_DEF_CONTEXTLINE ContextLine;
|
||||||
CALL_DEF_CONTEXTFILLAREA ContextFillArea;
|
CALL_DEF_CONTEXTFILLAREA ContextFillArea;
|
||||||
CALL_DEF_CONTEXTMARKER ContextMarker;
|
CALL_DEF_CONTEXTMARKER ContextMarker;
|
||||||
@ -105,9 +101,6 @@ public:
|
|||||||
|
|
||||||
CALL_DEF_PICKID PickId;
|
CALL_DEF_PICKID PickId;
|
||||||
|
|
||||||
unsigned IsDeleted : 1;
|
|
||||||
unsigned IsOpen : 1;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const Handle(Standard_Type)& TYPE(Graphic3d_CGroup);
|
const Handle(Standard_Type)& TYPE(Graphic3d_CGroup);
|
||||||
|
@ -31,8 +31,6 @@ public:
|
|||||||
|
|
||||||
int Priority;
|
int Priority;
|
||||||
int PreviousPriority;
|
int PreviousPriority;
|
||||||
int GroupBegin;
|
|
||||||
int GroupEnd;
|
|
||||||
|
|
||||||
CALL_DEF_CONTEXTLINE ContextLine;
|
CALL_DEF_CONTEXTLINE ContextLine;
|
||||||
CALL_DEF_CONTEXTFILLAREA ContextFillArea;
|
CALL_DEF_CONTEXTFILLAREA ContextFillArea;
|
||||||
|
@ -74,25 +74,12 @@ uses
|
|||||||
Structure from Graphic3d,
|
Structure from Graphic3d,
|
||||||
TextPath from Graphic3d,
|
TextPath from Graphic3d,
|
||||||
TypeOfComposition from Graphic3d,
|
TypeOfComposition from Graphic3d,
|
||||||
TypeOfPolygon from Graphic3d,
|
|
||||||
TypeOfPrimitive from Graphic3d,
|
TypeOfPrimitive from Graphic3d,
|
||||||
Vector from Graphic3d,
|
Vector from Graphic3d,
|
||||||
Array1OfVertex from Graphic3d,
|
Array1OfVertex from Graphic3d,
|
||||||
Array2OfVertex from Graphic3d,
|
Array2OfVertex from Graphic3d,
|
||||||
Vertex from Graphic3d,
|
Vertex from Graphic3d,
|
||||||
Array1OfVertexC from Graphic3d,
|
|
||||||
Array2OfVertexC from Graphic3d,
|
|
||||||
VertexC from Graphic3d,
|
|
||||||
Array1OfVertexN from Graphic3d,
|
|
||||||
Array2OfVertexN from Graphic3d,
|
|
||||||
VertexN from Graphic3d,
|
|
||||||
Array1OfVertexNC from Graphic3d,
|
|
||||||
Array2OfVertexNC from Graphic3d,
|
|
||||||
VertexNC from Graphic3d,
|
|
||||||
VerticalTextAlignment from Graphic3d,
|
VerticalTextAlignment from Graphic3d,
|
||||||
VertexNT from Graphic3d,
|
|
||||||
Array1OfVertexNT from Graphic3d,
|
|
||||||
Array2OfVertexNT from Graphic3d,
|
|
||||||
PrimitiveArray from Graphic3d,
|
PrimitiveArray from Graphic3d,
|
||||||
PtrFrameBuffer from Graphic3d,
|
PtrFrameBuffer from Graphic3d,
|
||||||
HArray1OfByte from TColStd,
|
HArray1OfByte from TColStd,
|
||||||
@ -201,11 +188,6 @@ is
|
|||||||
is deferred;
|
is deferred;
|
||||||
---Purpose: call_togl_cleargroup
|
---Purpose: call_togl_cleargroup
|
||||||
|
|
||||||
CloseGroup ( me : mutable;
|
|
||||||
ACGroup : CGroup from Graphic3d )
|
|
||||||
is deferred;
|
|
||||||
---Purpose: call_togl_closegroup
|
|
||||||
|
|
||||||
FaceContextGroup ( me : mutable;
|
FaceContextGroup ( me : mutable;
|
||||||
ACGroup : CGroup from Graphic3d;
|
ACGroup : CGroup from Graphic3d;
|
||||||
NoInsert : Integer from Standard )
|
NoInsert : Integer from Standard )
|
||||||
@ -238,11 +220,6 @@ is
|
|||||||
is deferred;
|
is deferred;
|
||||||
---Purpose: call_togl_markercontextgroup
|
---Purpose: call_togl_markercontextgroup
|
||||||
|
|
||||||
OpenGroup ( me : mutable;
|
|
||||||
ACGroup : CGroup from Graphic3d )
|
|
||||||
is deferred;
|
|
||||||
---Purpose: call_togl_opengroup
|
|
||||||
|
|
||||||
RemoveGroup ( me : mutable;
|
RemoveGroup ( me : mutable;
|
||||||
ACGroup : CGroup from Graphic3d )
|
ACGroup : CGroup from Graphic3d )
|
||||||
is deferred;
|
is deferred;
|
||||||
@ -500,29 +477,14 @@ is
|
|||||||
|
|
||||||
Marker ( me : mutable;
|
Marker ( me : mutable;
|
||||||
ACGroup : CGroup from Graphic3d;
|
ACGroup : CGroup from Graphic3d;
|
||||||
APoint : Vertex from Graphic3d;
|
APoint : Vertex from Graphic3d )
|
||||||
EvalMinMax : Boolean from Standard = Standard_True )
|
|
||||||
is deferred;
|
is deferred;
|
||||||
|
|
||||||
MarkerSet ( me : mutable;
|
MarkerSet ( me : mutable;
|
||||||
ACGroup : CGroup from Graphic3d;
|
ACGroup : CGroup from Graphic3d;
|
||||||
ListVertex : Array1OfVertex from Graphic3d;
|
ListVertex : Array1OfVertex from Graphic3d )
|
||||||
EvalMinMax : Boolean from Standard = Standard_True )
|
|
||||||
is deferred;
|
is deferred;
|
||||||
|
|
||||||
----------------------------------------
|
|
||||||
-- Category: Methods to create Polygon
|
|
||||||
-- for Purpose : see Graphic3d_Group.cdl
|
|
||||||
----------------------------------------
|
|
||||||
|
|
||||||
Polygon ( me : mutable;
|
|
||||||
ACGroup : CGroup from Graphic3d;
|
|
||||||
ListVertex : Array1OfVertex from Graphic3d;
|
|
||||||
AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
|
|
||||||
EvalMinMax : Boolean from Standard = Standard_True )
|
|
||||||
is deferred;
|
|
||||||
---Purpose: call_togl_polygon
|
|
||||||
|
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
-- Category: Methods to create Text
|
-- Category: Methods to create Text
|
||||||
-- for Purpose : see Graphic3d_Group.cdl
|
-- for Purpose : see Graphic3d_Group.cdl
|
||||||
@ -1013,15 +975,6 @@ is
|
|||||||
-- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
|
-- In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
|
||||||
-- Notice however that results may differ a lot and do not contain some elements.
|
-- Notice however that results may differ a lot and do not contain some elements.
|
||||||
|
|
||||||
RemovePrimitiveArray( me : mutable;
|
|
||||||
theCGroup : CGroup from Graphic3d;
|
|
||||||
thePArray : PrimitiveArray from Graphic3d )
|
|
||||||
is deferred;
|
|
||||||
---Purpose: Clear visualization data in graphical driver and
|
|
||||||
-- stop displaying the primitives array of the graphical group
|
|
||||||
-- <theCGroup>. This method is internal and should be used
|
|
||||||
-- by Graphic3d_Group only.
|
|
||||||
|
|
||||||
AddZLayer( me : mutable;
|
AddZLayer( me : mutable;
|
||||||
theCView : CView from Graphic3d;
|
theCView : CView from Graphic3d;
|
||||||
theLayerId : Integer from Standard )
|
theLayerId : Integer from Standard )
|
||||||
|
@ -90,8 +90,7 @@ void Graphic3d_GraphicDriver::PrintCGroup (const Graphic3d_CGroup& ACGroup, cons
|
|||||||
|
|
||||||
if (AField) {
|
if (AField) {
|
||||||
cout << "\tstruct id " << ACGroup.Struct->Id << "\n";
|
cout << "\tstruct id " << ACGroup.Struct->Id << "\n";
|
||||||
cout << "\tgroup labels " << ACGroup.LabelBegin << ", "
|
cout << "\tgroup\n";
|
||||||
<< ACGroup.LabelEnd << "\n";
|
|
||||||
cout << flush;
|
cout << flush;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,27 +83,13 @@ class Group from Graphic3d inherits TShared
|
|||||||
GraphicDriver from Graphic3d,
|
GraphicDriver from Graphic3d,
|
||||||
Structure from Graphic3d,
|
Structure from Graphic3d,
|
||||||
TextPath from Graphic3d,
|
TextPath from Graphic3d,
|
||||||
TypeOfPolygon from Graphic3d,
|
|
||||||
Vector from Graphic3d,
|
Vector from Graphic3d,
|
||||||
Array1OfVertex from Graphic3d,
|
Array1OfVertex from Graphic3d,
|
||||||
Array2OfVertex from Graphic3d,
|
Array2OfVertex from Graphic3d,
|
||||||
Vertex from Graphic3d,
|
Vertex from Graphic3d,
|
||||||
Array1OfVertexC from Graphic3d,
|
|
||||||
Array2OfVertexC from Graphic3d,
|
|
||||||
VertexC from Graphic3d,
|
|
||||||
Array1OfVertexN from Graphic3d,
|
|
||||||
Array2OfVertexN from Graphic3d,
|
|
||||||
VertexN from Graphic3d,
|
|
||||||
Array1OfVertexNC from Graphic3d,
|
|
||||||
Array2OfVertexNC from Graphic3d,
|
|
||||||
VertexNC from Graphic3d,
|
|
||||||
VerticalTextAlignment from Graphic3d,
|
VerticalTextAlignment from Graphic3d,
|
||||||
VertexNT from Graphic3d,
|
|
||||||
Array1OfVertexNT from Graphic3d,
|
|
||||||
Array2OfVertexNT from Graphic3d,
|
|
||||||
ArrayOfPrimitives from Graphic3d,
|
ArrayOfPrimitives from Graphic3d,
|
||||||
ListOfPArray from Graphic3d,
|
ListOfPArray from Graphic3d,
|
||||||
ListIteratorOfListOfPArray from Graphic3d,
|
|
||||||
TransModeFlags from Graphic3d,
|
TransModeFlags from Graphic3d,
|
||||||
CBounds from Graphic3d
|
CBounds from Graphic3d
|
||||||
|
|
||||||
@ -282,109 +268,6 @@ class Group from Graphic3d inherits TShared
|
|||||||
-- vertices.
|
-- vertices.
|
||||||
---Category: Methods to create Marker
|
---Category: Methods to create Marker
|
||||||
|
|
||||||
--------------------------------------
|
|
||||||
-- Category: Methods to create Polygon
|
|
||||||
--------------------------------------
|
|
||||||
|
|
||||||
--------------------------------------------------
|
|
||||||
-- Summary of Polygons --
|
|
||||||
-- --
|
|
||||||
-- They are limited to one boundary. --
|
|
||||||
-- --
|
|
||||||
-- The boundary should be closed. --
|
|
||||||
-- --
|
|
||||||
-- They should have at least three vertices. --
|
|
||||||
-- --
|
|
||||||
-- They should be planar. --
|
|
||||||
-- --
|
|
||||||
-- They should have a normal. --
|
|
||||||
-- --
|
|
||||||
-- The boundary is drawn only when the interior --
|
|
||||||
-- style is hollow. --
|
|
||||||
-- --
|
|
||||||
-- The boundary have the following attributes : --
|
|
||||||
-- --
|
|
||||||
-- Line Type. --
|
|
||||||
-- Line Width Scale Factor. --
|
|
||||||
-- Line Color. --
|
|
||||||
-- --
|
|
||||||
-- They have only interior attributes : --
|
|
||||||
-- --
|
|
||||||
-- Interior Style. --
|
|
||||||
-- Interior Color. --
|
|
||||||
-- Front Material. --
|
|
||||||
-- Back Material. --
|
|
||||||
--------------------------------------------------
|
|
||||||
|
|
||||||
Polygon ( me : mutable;
|
|
||||||
ListVertex : Array1OfVertex from Graphic3d;
|
|
||||||
AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
|
|
||||||
EvalMinMax : Boolean from Standard = Standard_True )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Links up points to create a face drawn
|
|
||||||
-- using the current fill attributes (AspectFillArea3d))
|
|
||||||
-- The first and last points are not duplicates.
|
|
||||||
---Category: Methods to create Polygon
|
|
||||||
|
|
||||||
PolygonSet ( me : mutable;
|
|
||||||
Bounds : Array1OfInteger from TColStd;
|
|
||||||
ListVertex : Array1OfVertex from Graphic3d;
|
|
||||||
AType : TypeOfPolygon from Graphic3d = Graphic3d_TOP_CONVEX;
|
|
||||||
EvalMinMax : Boolean from Standard = Standard_True )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Links up points to create a set of face drawn
|
|
||||||
-- using the current fill attributes (AspectFillArea3d))
|
|
||||||
-- The first and last points are not duplicates.
|
|
||||||
---Category: Methods to create Polygon
|
|
||||||
|
|
||||||
---------------------------------------
|
|
||||||
-- Category: Methods to create Polyline
|
|
||||||
---------------------------------------
|
|
||||||
|
|
||||||
--------------------------------------------
|
|
||||||
-- Summary of Polylines --
|
|
||||||
-- --
|
|
||||||
-- They should have two or more vertices. --
|
|
||||||
-- --
|
|
||||||
-- They have the following attributes. --
|
|
||||||
-- --
|
|
||||||
-- Line Type. --
|
|
||||||
-- Line Width Scale Factor. --
|
|
||||||
-- Line Color. --
|
|
||||||
--------------------------------------------
|
|
||||||
|
|
||||||
Polyline ( me : mutable;
|
|
||||||
APT1 : Vertex from Graphic3d;
|
|
||||||
APT2 : Vertex from Graphic3d;
|
|
||||||
EvalMinMax : Boolean from Standard = Standard_True )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Links up points to create a line drawn
|
|
||||||
-- using the current line attributes (AspectLine)
|
|
||||||
---Category: Methods to create Polyline
|
|
||||||
|
|
||||||
Polyline ( me : mutable;
|
|
||||||
ListVertex : Array1OfVertex from Graphic3d;
|
|
||||||
EvalMinMax : Boolean from Standard = Standard_True )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Links up points to create a line drawn
|
|
||||||
-- using the current line attributes (AspectLine)
|
|
||||||
---Category: Methods to create Polyline
|
|
||||||
|
|
||||||
Polyline ( me : mutable;
|
|
||||||
ListVertex : Array1OfVertexC from Graphic3d;
|
|
||||||
EvalMinMax : Boolean from Standard = Standard_True )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Links up points to create a line drawn
|
|
||||||
-- using the current line attributes (AspectLine)
|
|
||||||
-- except for the colour which is defined
|
|
||||||
-- for each vertex.
|
|
||||||
---Category: Methods to create Polyline
|
|
||||||
|
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
-- Category: Methods to create Text
|
-- Category: Methods to create Text
|
||||||
-----------------------------------
|
-----------------------------------
|
||||||
@ -511,17 +394,6 @@ class Group from Graphic3d inherits TShared
|
|||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Adds an array of primitives for display
|
---Purpose: Adds an array of primitives for display
|
||||||
|
|
||||||
RemovePrimitiveArray( me : mutable;
|
|
||||||
aRank : Integer from Standard)
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Remove the array of primitives of rank <aRank>
|
|
||||||
raises OutOfRange from Standard is static;
|
|
||||||
-- if <aRank> is < 1 or > ArrayNumber()
|
|
||||||
|
|
||||||
RemovePrimitiveArrays( me : mutable);
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Remove all array of primitives
|
|
||||||
|
|
||||||
UserDraw ( me : mutable;
|
UserDraw ( me : mutable;
|
||||||
AnObject : Address from Standard;
|
AnObject : Address from Standard;
|
||||||
EvalMinMax : Boolean from Standard = Standard_True;
|
EvalMinMax : Boolean from Standard = Standard_True;
|
||||||
@ -537,30 +409,6 @@ class Group from Graphic3d inherits TShared
|
|||||||
-- Category: Inquire methods
|
-- Category: Inquire methods
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
ArrayNumber( me )
|
|
||||||
returns Integer from Standard;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns the number of primitive array added in this group
|
|
||||||
|
|
||||||
InitDefinedArray( me:mutable );
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Initialize the array list iterator.
|
|
||||||
|
|
||||||
NextDefinedArray( me:mutable );
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Increments the array list iterator.
|
|
||||||
|
|
||||||
MoreDefinedArray( me:mutable )
|
|
||||||
returns Boolean from Standard;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns TRUE if more array exists in the list.
|
|
||||||
|
|
||||||
DefinedArray( me )
|
|
||||||
returns mutable ArrayOfPrimitives from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns the current array of primitives according
|
|
||||||
-- to the array list iterator value.
|
|
||||||
|
|
||||||
IsGroupPrimitivesAspectSet ( me;
|
IsGroupPrimitivesAspectSet ( me;
|
||||||
theAspect : GroupAspect from Graphic3d )
|
theAspect : GroupAspect from Graphic3d )
|
||||||
returns Boolean from Standard
|
returns Boolean from Standard
|
||||||
@ -640,13 +488,6 @@ class Group from Graphic3d inherits TShared
|
|||||||
-- Category: Private methods
|
-- Category: Private methods
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
Labels ( me;
|
|
||||||
LB, LE : in out Integer from Standard )
|
|
||||||
is static private;
|
|
||||||
---Level: Internal
|
|
||||||
---Purpose: Returns the position of the group in the structure.
|
|
||||||
---Category: Private methods
|
|
||||||
|
|
||||||
MinMaxCoord ( me;
|
MinMaxCoord ( me;
|
||||||
XMin, YMin, ZMin : out Real from Standard;
|
XMin, YMin, ZMin : out Real from Standard;
|
||||||
XMax, YMax, ZMax : out Real from Standard )
|
XMax, YMax, ZMax : out Real from Standard )
|
||||||
@ -665,22 +506,6 @@ class Group from Graphic3d inherits TShared
|
|||||||
-- contains the associated Structure of the Group <me>.
|
-- contains the associated Structure of the Group <me>.
|
||||||
---Category: Private methods
|
---Category: Private methods
|
||||||
|
|
||||||
-----------------------------
|
|
||||||
-- Category: Internal methods
|
|
||||||
-----------------------------
|
|
||||||
|
|
||||||
BeginPrimitives ( me : mutable )
|
|
||||||
is static;
|
|
||||||
---Level: Internal
|
|
||||||
---Category: Internal methods
|
|
||||||
|
|
||||||
EndPrimitives ( me : mutable )
|
|
||||||
is static;
|
|
||||||
---Level: Internal
|
|
||||||
---Category: Internal methods
|
|
||||||
|
|
||||||
--
|
|
||||||
|
|
||||||
fields
|
fields
|
||||||
|
|
||||||
--
|
--
|
||||||
@ -708,7 +533,6 @@ class Group from Graphic3d inherits TShared
|
|||||||
MyBounds : CBounds from Graphic3d;
|
MyBounds : CBounds from Graphic3d;
|
||||||
|
|
||||||
MyListOfPArray : ListOfPArray from Graphic3d;
|
MyListOfPArray : ListOfPArray from Graphic3d;
|
||||||
MyListOfPArrayIterator : ListIteratorOfListOfPArray from Graphic3d;
|
|
||||||
|
|
||||||
MyMarkArray : HArray1OfByte from TColStd;
|
MyMarkArray : HArray1OfByte from TColStd;
|
||||||
MyMarkWidth : Integer from Standard;
|
MyMarkWidth : Integer from Standard;
|
||||||
|
@ -77,49 +77,38 @@ MyListOfPArray()
|
|||||||
// This () is the instance of the class, the current groupe
|
// This () is the instance of the class, the current groupe
|
||||||
//Handle(Graphic3d_Group) me = Handle(Graphic3d_Group)::DownCast (This ());
|
//Handle(Graphic3d_Group) me = Handle(Graphic3d_Group)::DownCast (This ());
|
||||||
|
|
||||||
Standard_Integer TheLabelBegin, TheLabelEnd;
|
MyPtrStructure = (void *) AStructure.operator->();
|
||||||
|
MyStructure->Add (this);
|
||||||
|
|
||||||
// MyStructure = AStructure;
|
MyContainsFacet = Standard_False,
|
||||||
MyPtrStructure = (void *) AStructure.operator->();
|
MyIsEmpty = Standard_True;
|
||||||
MyStructure->GroupLabels (TheLabelBegin, TheLabelEnd);
|
|
||||||
MyStructure->Add (this);
|
|
||||||
|
|
||||||
MyContainsFacet = Standard_False,
|
MyCGroup.Struct = MyStructure->CStructure();
|
||||||
MyIsEmpty = Standard_True;
|
MyCGroup.Struct->Id = int (MyStructure->Identification ());
|
||||||
|
MyCGroup.ptrGroup = NULL;
|
||||||
|
|
||||||
MyCGroup.Struct = MyStructure->CStructure();
|
MyCGroup.ContextLine.IsDef = 0,
|
||||||
MyCGroup.Struct->Id = int (MyStructure->Identification ());
|
MyCGroup.ContextText.IsDef = 0,
|
||||||
MyCGroup.IsDeleted = 0;
|
MyCGroup.ContextMarker.IsDef = 0,
|
||||||
MyCGroup.IsOpen = 0;
|
MyCGroup.ContextFillArea.IsDef = 0;
|
||||||
MyCGroup.LabelBegin = int (TheLabelBegin);
|
|
||||||
MyCGroup.LabelEnd = int (TheLabelEnd);
|
|
||||||
|
|
||||||
MyCGroup.StructureEnd = Structure_END;
|
MyCGroup.ContextLine.IsSet = 0,
|
||||||
|
MyCGroup.ContextText.IsSet = 0,
|
||||||
|
MyCGroup.ContextMarker.IsSet = 0,
|
||||||
|
MyCGroup.ContextFillArea.IsSet = 0;
|
||||||
|
|
||||||
MyCGroup.ContextLine.IsDef = 0,
|
MyCGroup.PickId.IsDef = 0,
|
||||||
MyCGroup.ContextText.IsDef = 0,
|
MyCGroup.PickId.IsSet = 0,
|
||||||
MyCGroup.ContextMarker.IsDef = 0,
|
MyCGroup.PickId.Value = 0;
|
||||||
MyCGroup.ContextFillArea.IsDef = 0;
|
|
||||||
|
|
||||||
MyCGroup.ContextLine.IsSet = 0,
|
Handle(Aspect_GraphicDriver) agd =
|
||||||
MyCGroup.ContextText.IsSet = 0,
|
((MyStructure->StructureManager ())->GraphicDevice ())->GraphicDriver ();
|
||||||
MyCGroup.ContextMarker.IsSet = 0,
|
|
||||||
MyCGroup.ContextFillArea.IsSet = 0;
|
|
||||||
|
|
||||||
MyCGroup.PickId.IsDef = 0,
|
MyGraphicDriver = *(Handle(Graphic3d_GraphicDriver) *) &agd;
|
||||||
MyCGroup.PickId.IsSet = 0,
|
|
||||||
MyCGroup.PickId.Value = 0;
|
|
||||||
|
|
||||||
Handle(Aspect_GraphicDriver) agd =
|
MyGraphicDriver->Group (MyCGroup);
|
||||||
((MyStructure->StructureManager ())->GraphicDevice ())->GraphicDriver ();
|
|
||||||
|
|
||||||
MyGraphicDriver = *(Handle(Graphic3d_GraphicDriver) *) &agd;
|
MyMarkWidth = 0;
|
||||||
|
MyMarkHeight = 0;
|
||||||
MyGraphicDriver->Group (MyCGroup);
|
MyMarkArray.Nullify();
|
||||||
|
|
||||||
//MyCGroup.TransformPersistenceFlag = Graphic3d_TMF_None;
|
|
||||||
//MyCGroup.Struct->TransformPersistenceFlag = Graphic3d_TMF_None;
|
|
||||||
MyMarkWidth = 0;
|
|
||||||
MyMarkHeight = 0;
|
|
||||||
MyMarkArray.Nullify();
|
|
||||||
}
|
}
|
||||||
|
@ -18,10 +18,6 @@
|
|||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#define XDESTROY
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-Version
|
//-Version
|
||||||
|
|
||||||
//-Design Declaration des variables specifiques aux groupes
|
//-Design Declaration des variables specifiques aux groupes
|
||||||
@ -81,25 +77,22 @@ void Graphic3d_Group::Clear (Standard_Boolean theUpdateStructureMgr)
|
|||||||
Update ();
|
Update ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Group::Destroy () {
|
void Graphic3d_Group::Destroy ()
|
||||||
|
{
|
||||||
#ifdef DESTROY
|
|
||||||
cout << "Graphic3d_Group::Destroy ()\n";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// tell graphics driver to clear internal resources of the group
|
// tell graphics driver to clear internal resources of the group
|
||||||
if (!IsEmpty () && !MyGraphicDriver.IsNull ())
|
if (!IsEmpty () && !MyGraphicDriver.IsNull ())
|
||||||
MyGraphicDriver->ClearGroup (MyCGroup);
|
MyGraphicDriver->ClearGroup (MyCGroup);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Group::Remove () {
|
void Graphic3d_Group::Remove ()
|
||||||
|
{
|
||||||
if (IsDeleted ()) return;
|
if (IsDeleted ()) return;
|
||||||
|
|
||||||
MyCGroup.IsDeleted = 1;
|
|
||||||
MyGraphicDriver->RemoveGroup (MyCGroup);
|
MyGraphicDriver->RemoveGroup (MyCGroup);
|
||||||
MyStructure->Remove (this);
|
MyStructure->Remove (this);
|
||||||
|
MyCGroup.ptrGroup = NULL;
|
||||||
|
|
||||||
Update ();
|
Update ();
|
||||||
|
|
||||||
MyBounds.XMin = ShortRealLast (),
|
MyBounds.XMin = ShortRealLast (),
|
||||||
@ -113,37 +106,4 @@ void Graphic3d_Group::Remove () {
|
|||||||
if (MyContainsFacet) MyStructure->GroupsWithFacet (-1);
|
if (MyContainsFacet) MyStructure->GroupsWithFacet (-1);
|
||||||
MyContainsFacet = Standard_False,
|
MyContainsFacet = Standard_False,
|
||||||
MyIsEmpty = Standard_True;
|
MyIsEmpty = Standard_True;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Group::BeginPrimitives () {
|
|
||||||
|
|
||||||
if (IsDeleted ()) return;
|
|
||||||
if (MyCGroup.IsOpen) return;
|
|
||||||
|
|
||||||
MyCGroup.IsOpen = 1;
|
|
||||||
|
|
||||||
MyGraphicDriver->OpenGroup (MyCGroup);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Group::EndPrimitives () {
|
|
||||||
|
|
||||||
if (IsDeleted ()) return;
|
|
||||||
if (! MyCGroup.IsOpen) return;
|
|
||||||
|
|
||||||
MyCGroup.IsOpen = 0;
|
|
||||||
|
|
||||||
MyGraphicDriver->CloseGroup (MyCGroup);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/*void Graphic3d_Group::SetTransformPersistence( const Graphic3d_TransModeFlags& AFlag )
|
|
||||||
{
|
|
||||||
//MyCGroup.TransformPersistenceFlag = AFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
Graphic3d_TransModeFlags Graphic3d_Group::TransformPersistence() const
|
|
||||||
{
|
|
||||||
//return MyCGroup.TransformPersistenceFlag;
|
|
||||||
}*/
|
|
||||||
|
@ -57,14 +57,14 @@ void Graphic3d_Group::Text (
|
|||||||
|
|
||||||
// Min-Max Update
|
// Min-Max Update
|
||||||
if (EvalMinMax) {
|
if (EvalMinMax) {
|
||||||
Standard_Real X, Y, Z;
|
Standard_ShortReal X, Y, Z;
|
||||||
APoint.Coord (X, Y, Z);
|
APoint.Coord (X, Y, Z);
|
||||||
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
|
if (X < MyBounds.XMin) MyBounds.XMin = X;
|
||||||
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
|
if (Y < MyBounds.YMin) MyBounds.YMin = Y;
|
||||||
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
|
if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
|
||||||
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
|
if (X > MyBounds.XMax) MyBounds.XMax = X;
|
||||||
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
|
if (Y > MyBounds.YMax) MyBounds.YMax = Y;
|
||||||
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
|
if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
|
||||||
}
|
}
|
||||||
|
|
||||||
MyGraphicDriver->Text(MyCGroup, AText, APoint, AHeight, AAngle, ATp, AHta, AVta, EvalMinMax);
|
MyGraphicDriver->Text(MyCGroup, AText, APoint, AHeight, AAngle, ATp, AHta, AVta, EvalMinMax);
|
||||||
@ -85,14 +85,14 @@ void Graphic3d_Group::Text (
|
|||||||
|
|
||||||
// Min-Max Update
|
// Min-Max Update
|
||||||
if (EvalMinMax) {
|
if (EvalMinMax) {
|
||||||
Standard_Real X, Y, Z;
|
Standard_ShortReal X, Y, Z;
|
||||||
APoint.Coord (X, Y, Z);
|
APoint.Coord (X, Y, Z);
|
||||||
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
|
if (X < MyBounds.XMin) MyBounds.XMin = X;
|
||||||
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
|
if (Y < MyBounds.YMin) MyBounds.YMin = Y;
|
||||||
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
|
if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
|
||||||
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
|
if (X > MyBounds.XMax) MyBounds.XMax = X;
|
||||||
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
|
if (Y > MyBounds.YMax) MyBounds.YMax = Y;
|
||||||
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
|
if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
|
||||||
}
|
}
|
||||||
|
|
||||||
MyGraphicDriver->Text (MyCGroup, AText, APoint, AHeight, EvalMinMax);
|
MyGraphicDriver->Text (MyCGroup, AText, APoint, AHeight, EvalMinMax);
|
||||||
@ -117,14 +117,14 @@ void Graphic3d_Group::Text (
|
|||||||
|
|
||||||
// Min-Max Update
|
// Min-Max Update
|
||||||
if (EvalMinMax) {
|
if (EvalMinMax) {
|
||||||
Standard_Real X, Y, Z;
|
Standard_ShortReal X, Y, Z;
|
||||||
APoint.Coord (X, Y, Z);
|
APoint.Coord (X, Y, Z);
|
||||||
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
|
if (X < MyBounds.XMin) MyBounds.XMin = X;
|
||||||
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
|
if (Y < MyBounds.YMin) MyBounds.YMin = Y;
|
||||||
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
|
if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
|
||||||
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
|
if (X > MyBounds.XMax) MyBounds.XMax = X;
|
||||||
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
|
if (Y > MyBounds.YMax) MyBounds.YMax = Y;
|
||||||
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
|
if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
|
||||||
}
|
}
|
||||||
|
|
||||||
MyGraphicDriver->Text(MyCGroup, AText, APoint, AHeight, AAngle, ATp, AHta, AVta, EvalMinMax);
|
MyGraphicDriver->Text(MyCGroup, AText, APoint, AHeight, AAngle, ATp, AHta, AVta, EvalMinMax);
|
||||||
@ -145,14 +145,14 @@ void Graphic3d_Group::Text (
|
|||||||
|
|
||||||
// Min-Max Update
|
// Min-Max Update
|
||||||
if (EvalMinMax) {
|
if (EvalMinMax) {
|
||||||
Standard_Real X, Y, Z;
|
Standard_ShortReal X, Y, Z;
|
||||||
APoint.Coord (X, Y, Z);
|
APoint.Coord (X, Y, Z);
|
||||||
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
|
if (X < MyBounds.XMin) MyBounds.XMin = X;
|
||||||
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
|
if (Y < MyBounds.YMin) MyBounds.YMin = Y;
|
||||||
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
|
if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
|
||||||
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
|
if (X > MyBounds.XMax) MyBounds.XMax = X;
|
||||||
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
|
if (Y > MyBounds.YMax) MyBounds.YMax = Y;
|
||||||
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
|
if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
|
||||||
}
|
}
|
||||||
|
|
||||||
MyGraphicDriver->Text (MyCGroup, AText, APoint, AHeight, EvalMinMax);
|
MyGraphicDriver->Text (MyCGroup, AText, APoint, AHeight, EvalMinMax);
|
||||||
|
@ -60,61 +60,6 @@ void Graphic3d_Group :: AddPrimitiveArray ( const Handle(Graphic3d_ArrayOfPrimit
|
|||||||
Update ();
|
Update ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Group :: RemovePrimitiveArrays () {
|
|
||||||
// clear primitives array's visualization data in graphics driver and remove
|
|
||||||
// references to it in driver
|
|
||||||
if (!IsEmpty() && !MyGraphicDriver.IsNull())
|
|
||||||
{
|
|
||||||
for (Graphic3d_ListIteratorOfListOfPArray it (MyListOfPArray);
|
|
||||||
it.More(); it.Next())
|
|
||||||
MyGraphicDriver->RemovePrimitiveArray (MyCGroup, it.Value()->Array());
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove references to primitives arrays
|
|
||||||
MyListOfPArray.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Integer Graphic3d_Group :: ArrayNumber () const {
|
|
||||||
|
|
||||||
return MyListOfPArray.Extent();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Group :: InitDefinedArray() {
|
|
||||||
MyListOfPArrayIterator.Initialize(MyListOfPArray);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Group :: NextDefinedArray() {
|
|
||||||
MyListOfPArrayIterator.Next();
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Boolean Graphic3d_Group :: MoreDefinedArray() {
|
|
||||||
return MyListOfPArrayIterator.More();
|
|
||||||
}
|
|
||||||
|
|
||||||
Handle(Graphic3d_ArrayOfPrimitives) Graphic3d_Group :: DefinedArray() const {
|
|
||||||
|
|
||||||
return MyListOfPArrayIterator.Value();
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Group :: RemovePrimitiveArray ( const Standard_Integer aRank ) {
|
|
||||||
|
|
||||||
if( aRank < 1 || aRank > ArrayNumber() ) {
|
|
||||||
Standard_OutOfRange::Raise(" BAD ARRAY index");
|
|
||||||
}
|
|
||||||
Graphic3d_ListIteratorOfListOfPArray it(MyListOfPArray);
|
|
||||||
for( Standard_Integer i=1 ; it.More() ; it.Next(),i++ ) {
|
|
||||||
if( aRank == i ) break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// clear primitives array's visualization data in graphics driver and remove
|
|
||||||
// references to it in driver
|
|
||||||
if (!IsEmpty() && !MyGraphicDriver.IsNull())
|
|
||||||
MyGraphicDriver->RemovePrimitiveArray (MyCGroup, it.Value()->Array());
|
|
||||||
|
|
||||||
// remove references to primitives array
|
|
||||||
MyListOfPArray.Remove (it);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Group :: UserDraw ( const Standard_Address AnObject,
|
void Graphic3d_Group :: UserDraw ( const Standard_Address AnObject,
|
||||||
const Standard_Boolean EvalMinMax,
|
const Standard_Boolean EvalMinMax,
|
||||||
const Standard_Boolean ContainsFacet )
|
const Standard_Boolean ContainsFacet )
|
||||||
|
@ -46,10 +46,7 @@
|
|||||||
|
|
||||||
Standard_Boolean Graphic3d_Group::IsDeleted () const {
|
Standard_Boolean Graphic3d_Group::IsDeleted () const {
|
||||||
|
|
||||||
if ( (MyCGroup.IsDeleted) || (MyStructure->IsDeleted ()) )
|
return ( (MyCGroup.ptrGroup == NULL) || (MyStructure->IsDeleted ()) );
|
||||||
return (Standard_True);
|
|
||||||
else
|
|
||||||
return (Standard_False);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -117,13 +114,6 @@ void Graphic3d_Group::MinMaxCoord (Standard_Real& XMin, Standard_Real& YMin, Sta
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Group::Labels (Standard_Integer& LB, Standard_Integer& LE) const {
|
|
||||||
|
|
||||||
LB = Standard_Integer (MyCGroup.LabelBegin);
|
|
||||||
LE = Standard_Integer (MyCGroup.LabelEnd);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Group::Update () const {
|
void Graphic3d_Group::Update () const {
|
||||||
|
|
||||||
if (IsDeleted ()) return;
|
if (IsDeleted ()) return;
|
||||||
|
@ -40,59 +40,53 @@
|
|||||||
|
|
||||||
//-Methods, in order
|
//-Methods, in order
|
||||||
|
|
||||||
void Graphic3d_Group::Marker (const Graphic3d_Vertex& APoint, const Standard_Boolean EvalMinMax) {
|
void Graphic3d_Group::Marker (const Graphic3d_Vertex &APoint, const Standard_Boolean EvalMinMax)
|
||||||
|
{
|
||||||
if (IsDeleted ()) return;
|
if (IsDeleted ()) return;
|
||||||
|
|
||||||
MyIsEmpty = Standard_False;
|
MyIsEmpty = Standard_False;
|
||||||
|
|
||||||
// Min-Max Update
|
// Min-Max Update
|
||||||
if (EvalMinMax) {
|
if (EvalMinMax) {
|
||||||
Standard_Real X, Y, Z;
|
Standard_ShortReal X, Y, Z;
|
||||||
APoint.Coord (X, Y, Z);
|
APoint.Coord (X, Y, Z);
|
||||||
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
|
if (X < MyBounds.XMin) MyBounds.XMin = X;
|
||||||
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
|
if (Y < MyBounds.YMin) MyBounds.YMin = Y;
|
||||||
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
|
if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
|
||||||
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
|
if (X > MyBounds.XMax) MyBounds.XMax = X;
|
||||||
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
|
if (Y > MyBounds.YMax) MyBounds.YMax = Y;
|
||||||
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
|
if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
|
||||||
}
|
}
|
||||||
|
|
||||||
MyGraphicDriver->Marker (MyCGroup, APoint, EvalMinMax);
|
MyGraphicDriver->Marker (MyCGroup, APoint);
|
||||||
|
|
||||||
Update ();
|
Update ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Group::MarkerSet (const Graphic3d_Array1OfVertex& ListVertex, const Standard_Boolean EvalMinMax) {
|
void Graphic3d_Group::MarkerSet (const Graphic3d_Array1OfVertex &ListVertex, const Standard_Boolean EvalMinMax)
|
||||||
|
{
|
||||||
if (IsDeleted ()) return;
|
if (IsDeleted ()) return;
|
||||||
|
|
||||||
MyIsEmpty = Standard_False;
|
MyIsEmpty = Standard_False;
|
||||||
|
|
||||||
Standard_Integer i, j;
|
|
||||||
|
|
||||||
i = ListVertex.Length ();
|
|
||||||
|
|
||||||
// Min-Max Update
|
// Min-Max Update
|
||||||
if (EvalMinMax) {
|
if (EvalMinMax) {
|
||||||
Standard_Real X, Y, Z;
|
Standard_ShortReal X, Y, Z;
|
||||||
Standard_Integer Lower = ListVertex.Lower ();
|
Standard_Integer i = ListVertex.Lower ();
|
||||||
Standard_Integer Upper = ListVertex.Upper ();
|
const Standard_Integer Upper = ListVertex.Upper ();
|
||||||
// Parcours des sommets
|
// Parcours des sommets
|
||||||
for (j=0, i=Lower; i<=Upper; i++, j++) {
|
for (; i<=Upper; i++) {
|
||||||
ListVertex (i).Coord (X, Y, Z);
|
ListVertex (i).Coord (X, Y, Z);
|
||||||
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
|
if (X < MyBounds.XMin) MyBounds.XMin = X;
|
||||||
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
|
if (Y < MyBounds.YMin) MyBounds.YMin = Y;
|
||||||
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
|
if (Z < MyBounds.ZMin) MyBounds.ZMin = Z;
|
||||||
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
|
if (X > MyBounds.XMax) MyBounds.XMax = X;
|
||||||
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
|
if (Y > MyBounds.YMax) MyBounds.YMax = Y;
|
||||||
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
|
if (Z > MyBounds.ZMax) MyBounds.ZMax = Z;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MyGraphicDriver->MarkerSet (MyCGroup, ListVertex, EvalMinMax);
|
MyGraphicDriver->MarkerSet (MyCGroup, ListVertex);
|
||||||
|
|
||||||
Update ();
|
Update ();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,121 +0,0 @@
|
|||||||
// Created by: NW,JPB,CAL
|
|
||||||
// Copyright (c) 1991-1999 Matra Datavision
|
|
||||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
||||||
//
|
|
||||||
// The content of this file is subject to the Open CASCADE Technology Public
|
|
||||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
|
||||||
// except in compliance with the License. Please obtain a copy of the License
|
|
||||||
// at http://www.opencascade.org and read it completely before using this file.
|
|
||||||
//
|
|
||||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
||||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
||||||
//
|
|
||||||
// The Original Code and all software distributed under the License is
|
|
||||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
||||||
// Initial Developer hereby disclaims all such warranties, including without
|
|
||||||
// limitation, any warranties of merchantability, fitness for a particular
|
|
||||||
// purpose or non-infringement. Please see the License for the specific terms
|
|
||||||
// and conditions governing the rights and limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
// Modified
|
|
||||||
// 27/08/97 ; PCT : ajout coordonnee texture
|
|
||||||
|
|
||||||
|
|
||||||
//-Version
|
|
||||||
|
|
||||||
//-Design Declaration des variables specifiques aux groupes
|
|
||||||
// de primitives
|
|
||||||
|
|
||||||
//-Warning Un groupe est defini dans une structure
|
|
||||||
// Il s'agit de la plus petite entite editable
|
|
||||||
|
|
||||||
//-References
|
|
||||||
|
|
||||||
//-Language C++ 2.0
|
|
||||||
|
|
||||||
//-Declarations
|
|
||||||
|
|
||||||
// for the class
|
|
||||||
#include <Graphic3d_Group.jxx>
|
|
||||||
#include <Graphic3d_Group.pxx>
|
|
||||||
|
|
||||||
#include <Graphic3d_VertexN.hxx>
|
|
||||||
#include <Graphic3d_VertexNT.hxx>
|
|
||||||
|
|
||||||
//-Methods, in order
|
|
||||||
|
|
||||||
void Graphic3d_Group::Polygon (const Graphic3d_Array1OfVertex& ListVertex, const Graphic3d_TypeOfPolygon AType, const Standard_Boolean EvalMinMax) {
|
|
||||||
|
|
||||||
if (IsDeleted ()) return;
|
|
||||||
|
|
||||||
if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
|
|
||||||
MyContainsFacet = Standard_True;
|
|
||||||
MyIsEmpty = Standard_False;
|
|
||||||
|
|
||||||
// Min-Max Update
|
|
||||||
if (EvalMinMax) {
|
|
||||||
|
|
||||||
Standard_Real X, Y, Z;
|
|
||||||
Standard_Integer i, j;
|
|
||||||
Standard_Integer Lower = ListVertex.Lower ();
|
|
||||||
Standard_Integer Upper = ListVertex.Upper ();
|
|
||||||
// Parcours des sommets
|
|
||||||
for (j=0, i=Lower; i<=Upper; i++, j++) {
|
|
||||||
ListVertex (i).Coord (X, Y, Z);
|
|
||||||
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
|
|
||||||
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
|
|
||||||
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
|
|
||||||
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
|
|
||||||
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
|
|
||||||
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MyGraphicDriver->Polygon (MyCGroup, ListVertex, AType, EvalMinMax);
|
|
||||||
|
|
||||||
Update ();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Group::PolygonSet (const TColStd_Array1OfInteger& Bounds, const Graphic3d_Array1OfVertex& ListVertex, const Graphic3d_TypeOfPolygon AType, const Standard_Boolean EvalMinMax) {
|
|
||||||
|
|
||||||
if (IsDeleted ()) return;
|
|
||||||
|
|
||||||
if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
|
|
||||||
MyContainsFacet = Standard_True;
|
|
||||||
MyIsEmpty = Standard_False;
|
|
||||||
|
|
||||||
Standard_Real X, Y, Z;
|
|
||||||
|
|
||||||
Standard_Integer i, ii;
|
|
||||||
Standard_Integer j;
|
|
||||||
Standard_Integer begin_points;
|
|
||||||
Standard_Integer end_points;
|
|
||||||
Standard_Integer nbpoints;
|
|
||||||
Standard_Integer Lower, Upper;
|
|
||||||
|
|
||||||
begin_points = ListVertex.Lower ();
|
|
||||||
end_points = ListVertex.Upper ();
|
|
||||||
|
|
||||||
Lower = Bounds.Lower ();
|
|
||||||
Upper = Bounds.Upper ();
|
|
||||||
|
|
||||||
// Parcours des facettes
|
|
||||||
for (j=Lower; j<=Upper; j++) {
|
|
||||||
nbpoints = Bounds.Value (j);
|
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex ListOfVertex (0, nbpoints-1);
|
|
||||||
|
|
||||||
// Parcours des sommets
|
|
||||||
for (i=0, ii=begin_points;
|
|
||||||
((ii<=end_points) && (i<=nbpoints-1)); i++, ii++) {
|
|
||||||
ListVertex (ii).Coord (X, Y, Z);
|
|
||||||
ListOfVertex (i).SetCoord (X, Y, Z);
|
|
||||||
}
|
|
||||||
|
|
||||||
Polygon (ListOfVertex, AType, EvalMinMax);
|
|
||||||
begin_points += nbpoints;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,112 +0,0 @@
|
|||||||
// Created by: NW,JPB,CAL
|
|
||||||
// Copyright (c) 1991-1999 Matra Datavision
|
|
||||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
||||||
//
|
|
||||||
// The content of this file is subject to the Open CASCADE Technology Public
|
|
||||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
|
||||||
// except in compliance with the License. Please obtain a copy of the License
|
|
||||||
// at http://www.opencascade.org and read it completely before using this file.
|
|
||||||
//
|
|
||||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
||||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
||||||
//
|
|
||||||
// The Original Code and all software distributed under the License is
|
|
||||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
||||||
// Initial Developer hereby disclaims all such warranties, including without
|
|
||||||
// limitation, any warranties of merchantability, fitness for a particular
|
|
||||||
// purpose or non-infringement. Please see the License for the specific terms
|
|
||||||
// and conditions governing the rights and limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
// 11/97 ; CAL : ajout polyline par 2 points
|
|
||||||
|
|
||||||
|
|
||||||
//-Version
|
|
||||||
|
|
||||||
//-Design Declaration des variables specifiques aux groupes
|
|
||||||
// de primitives
|
|
||||||
|
|
||||||
//-Warning Un groupe est defini dans une structure
|
|
||||||
// Il s'agit de la plus petite entite editable
|
|
||||||
|
|
||||||
//-References
|
|
||||||
|
|
||||||
//-Language C++ 2.0
|
|
||||||
|
|
||||||
//-Declarations
|
|
||||||
|
|
||||||
// for the class
|
|
||||||
#include <Graphic3d_Group.jxx>
|
|
||||||
#include <Graphic3d_Group.pxx>
|
|
||||||
|
|
||||||
#include <Graphic3d_ArrayOfPolylines.hxx>
|
|
||||||
#include <Graphic3d_VertexC.hxx>
|
|
||||||
#include <gp_Pnt.hxx>
|
|
||||||
|
|
||||||
void Graphic3d_Group::Polyline (const Graphic3d_Array1OfVertex& theListVertex,
|
|
||||||
const Standard_Boolean theToEvalMinMax)
|
|
||||||
{
|
|
||||||
if (IsDeleted())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines (theListVertex.Length());
|
|
||||||
|
|
||||||
Standard_Real aX, aY, aZ;
|
|
||||||
Standard_Integer aVertLower = theListVertex.Lower();
|
|
||||||
Standard_Integer aVertUpper = theListVertex.Upper();
|
|
||||||
for (Standard_Integer aVertIter = aVertLower; aVertIter <= aVertUpper; ++aVertIter)
|
|
||||||
{
|
|
||||||
const Graphic3d_Vertex& aVert = theListVertex (aVertIter);
|
|
||||||
aVert.Coord (aX, aY, aZ);
|
|
||||||
aPrims->AddVertex (aX, aY, aZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
AddPrimitiveArray (aPrims, theToEvalMinMax);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Group::Polyline (const Graphic3d_Array1OfVertexC& theListVertex,
|
|
||||||
const Standard_Boolean theToEvalMinMax)
|
|
||||||
{
|
|
||||||
if (IsDeleted())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Handle(Graphic3d_ArrayOfPrimitives) aPrims
|
|
||||||
= new Graphic3d_ArrayOfPolylines (theListVertex.Length(), 0, 0, Standard_True); // color per vertex
|
|
||||||
|
|
||||||
Standard_Real aX, aY, aZ;
|
|
||||||
Standard_Integer aVertLower = theListVertex.Lower();
|
|
||||||
Standard_Integer aVertUpper = theListVertex.Upper();
|
|
||||||
for (Standard_Integer aVertIter = aVertLower; aVertIter <= aVertUpper; ++aVertIter)
|
|
||||||
{
|
|
||||||
const Graphic3d_VertexC& aVert = theListVertex (aVertIter);
|
|
||||||
aVert.Coord (aX, aY, aZ);
|
|
||||||
aPrims->AddVertex (gp_Pnt (aX, aY, aZ), aVert.Color());
|
|
||||||
}
|
|
||||||
|
|
||||||
AddPrimitiveArray (aPrims, theToEvalMinMax);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Group::Polyline (const Graphic3d_Vertex& thePnt1,
|
|
||||||
const Graphic3d_Vertex& thePnt2,
|
|
||||||
const Standard_Boolean theToEvalMinMax)
|
|
||||||
{
|
|
||||||
if (IsDeleted())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Handle(Graphic3d_ArrayOfPrimitives) aPrims = new Graphic3d_ArrayOfPolylines (2);
|
|
||||||
|
|
||||||
Standard_Real aX, aY, aZ;
|
|
||||||
thePnt1.Coord (aX, aY, aZ);
|
|
||||||
aPrims->AddVertex (aX, aY, aZ);
|
|
||||||
|
|
||||||
thePnt2.Coord (aX, aY, aZ);
|
|
||||||
aPrims->AddVertex (aX, aY, aZ);
|
|
||||||
|
|
||||||
AddPrimitiveArray (aPrims, theToEvalMinMax);
|
|
||||||
}
|
|
@ -587,8 +587,8 @@ void Graphic3d_Group::SetPrimitivesAspect (const Handle(Graphic3d_AspectFillArea
|
|||||||
Standard_ShortReal aPolyFactor, aPolyUnits;
|
Standard_ShortReal aPolyFactor, aPolyUnits;
|
||||||
CTX->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits);
|
CTX->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits);
|
||||||
MyCGroup.ContextFillArea.PolygonOffsetMode = aPolyMode;
|
MyCGroup.ContextFillArea.PolygonOffsetMode = aPolyMode;
|
||||||
MyCGroup.ContextFillArea.PolygonOffsetFactor = aPolyFactor;
|
MyCGroup.ContextFillArea.PolygonOffsetFactor = (Standard_ShortReal)aPolyFactor;
|
||||||
MyCGroup.ContextFillArea.PolygonOffsetUnits = aPolyUnits;
|
MyCGroup.ContextFillArea.PolygonOffsetUnits = (Standard_ShortReal)aPolyUnits;
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
|
|
||||||
int noinsert = 0;
|
int noinsert = 0;
|
||||||
@ -1110,8 +1110,7 @@ void Graphic3d_Group::GroupPrimitivesAspect (const Handle(Graphic3d_AspectLine3d
|
|||||||
CTXF->SetFrontMaterial (Front);
|
CTXF->SetFrontMaterial (Front);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Group::PrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF) const {
|
void Graphic3d_Group::PrimitivesAspect (const Handle(Graphic3d_AspectLine3d)& CTXL, const Handle(Graphic3d_AspectText3d)& CTXT, const Handle(Graphic3d_AspectMarker3d)& CTXM, const Handle(Graphic3d_AspectFillArea3d)& CTXF) const
|
||||||
|
{
|
||||||
GroupPrimitivesAspect (CTXL, CTXT, CTXM, CTXF);
|
GroupPrimitivesAspect (CTXL, CTXT, CTXM, CTXF);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -72,9 +72,8 @@ uses
|
|||||||
TypeOfPrimitive from Graphic3d,
|
TypeOfPrimitive from Graphic3d,
|
||||||
TypeOfStructure from Graphic3d,
|
TypeOfStructure from Graphic3d,
|
||||||
Vector from Graphic3d,
|
Vector from Graphic3d,
|
||||||
VertexNC from Graphic3d,
|
|
||||||
Vertex from Graphic3d,
|
Vertex from Graphic3d,
|
||||||
TransModeFlags from Graphic3d,
|
TransModeFlags from Graphic3d,
|
||||||
Pnt from gp
|
Pnt from gp
|
||||||
|
|
||||||
raises
|
raises
|
||||||
@ -236,8 +235,8 @@ is
|
|||||||
---Level: Public
|
---Level: Public
|
||||||
---Purpose: Modifies the order of displaying the structure.
|
---Purpose: Modifies the order of displaying the structure.
|
||||||
-- Values are between 0 and 10.
|
-- Values are between 0 and 10.
|
||||||
-- Structures are drawn according to their display priorities
|
-- Structures are drawn according to their display priorities
|
||||||
-- in ascending order.
|
-- in ascending order.
|
||||||
-- A structure of priority 10 is displayed the last and appears over the others.
|
-- A structure of priority 10 is displayed the last and appears over the others.
|
||||||
-- The default value is 5.
|
-- The default value is 5.
|
||||||
-- Category: Methods to modify the class definition
|
-- Category: Methods to modify the class definition
|
||||||
@ -860,13 +859,6 @@ is
|
|||||||
---Purpose: Suppress the highlight for the structure <me>.
|
---Purpose: Suppress the highlight for the structure <me>.
|
||||||
---Category: Private methods
|
---Category: Private methods
|
||||||
|
|
||||||
GroupLabels ( me : mutable;
|
|
||||||
LB, LE : in out Integer from Standard )
|
|
||||||
is static private;
|
|
||||||
---Level: Internal
|
|
||||||
---Purpose: Returns the labels for a new group in the structure <me>.
|
|
||||||
---Category: Private methods
|
|
||||||
|
|
||||||
Identification ( me )
|
Identification ( me )
|
||||||
returns Integer from Standard
|
returns Integer from Standard
|
||||||
is static;
|
is static;
|
||||||
@ -993,9 +985,6 @@ fields
|
|||||||
-- the associated C structure
|
-- the associated C structure
|
||||||
MyCStructure : CStructure from Graphic3d;
|
MyCStructure : CStructure from Graphic3d;
|
||||||
|
|
||||||
-- the group identifier generator
|
|
||||||
MyGroupGenId : GenId from Aspect;
|
|
||||||
|
|
||||||
-- the structures to which the structure is attached
|
-- the structures to which the structure is attached
|
||||||
MyAncestors : SequenceOfAddress from TColStd;
|
MyAncestors : SequenceOfAddress from TColStd;
|
||||||
|
|
||||||
|
@ -112,7 +112,6 @@
|
|||||||
//-Constructors
|
//-Constructors
|
||||||
|
|
||||||
Graphic3d_Structure::Graphic3d_Structure (const Handle(Graphic3d_StructureManager)& AManager):
|
Graphic3d_Structure::Graphic3d_Structure (const Handle(Graphic3d_StructureManager)& AManager):
|
||||||
MyGroupGenId (Group_IDMIN, Group_IDMAX),
|
|
||||||
MyAncestors (),
|
MyAncestors (),
|
||||||
MyDescendants (),
|
MyDescendants (),
|
||||||
MyGroups (),
|
MyGroups (),
|
||||||
@ -171,9 +170,6 @@ MyHighlightColor (Quantity_NOC_WHITE)
|
|||||||
MyCStructure.IsInfinite = 0,
|
MyCStructure.IsInfinite = 0,
|
||||||
MyCStructure.HLRValidation = 0;
|
MyCStructure.HLRValidation = 0;
|
||||||
|
|
||||||
MyCStructure.GroupBegin = Structure_GROUPBEGIN;
|
|
||||||
MyCStructure.GroupEnd = Structure_GROUPEND;
|
|
||||||
|
|
||||||
MyCStructure.ContextLine.IsDef = 1,
|
MyCStructure.ContextLine.IsDef = 1,
|
||||||
MyCStructure.ContextFillArea.IsDef = 1,
|
MyCStructure.ContextFillArea.IsDef = 1,
|
||||||
MyCStructure.ContextMarker.IsDef = 1,
|
MyCStructure.ContextMarker.IsDef = 1,
|
||||||
@ -236,10 +232,7 @@ void Graphic3d_Structure::Clear (const Standard_Boolean WithDestruction)
|
|||||||
|
|
||||||
// only then remove group references
|
// only then remove group references
|
||||||
if (WithDestruction)
|
if (WithDestruction)
|
||||||
{
|
|
||||||
MyGroupGenId.Free();
|
|
||||||
MyGroups.Clear();
|
MyGroups.Clear();
|
||||||
}
|
|
||||||
|
|
||||||
MyStructureManager->Clear (this, WithDestruction);
|
MyStructureManager->Clear (this, WithDestruction);
|
||||||
|
|
||||||
@ -726,12 +719,6 @@ void Graphic3d_Structure::GraphicClear (const Standard_Boolean WithDestruction)
|
|||||||
|
|
||||||
if (WithDestruction)
|
if (WithDestruction)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
* void Prs3d_Presentation::Clear () {
|
|
||||||
* Graphic3d_Structure::Clear ();
|
|
||||||
* myCurrentGroup = new Graphic3d_Group (this);
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
while (!MyGroups.IsEmpty())
|
while (!MyGroups.IsEmpty())
|
||||||
{
|
{
|
||||||
Handle(Graphic3d_Group) aGroup = MyGroups.First();
|
Handle(Graphic3d_Group) aGroup = MyGroups.First();
|
||||||
@ -1251,8 +1238,8 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectFill
|
|||||||
Standard_ShortReal aPolyFactor, aPolyUnits;
|
Standard_ShortReal aPolyFactor, aPolyUnits;
|
||||||
CTX->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits);
|
CTX->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits);
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetMode = aPolyMode;
|
MyCStructure.ContextFillArea.PolygonOffsetMode = aPolyMode;
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetFactor = aPolyFactor;
|
MyCStructure.ContextFillArea.PolygonOffsetFactor = (Standard_ShortReal)aPolyFactor;
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetUnits = aPolyUnits;
|
MyCStructure.ContextFillArea.PolygonOffsetUnits = (Standard_ShortReal)aPolyUnits;
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
|
|
||||||
MyGraphicDriver->ContextStructure (MyCStructure);
|
MyGraphicDriver->ContextStructure (MyCStructure);
|
||||||
@ -1306,7 +1293,7 @@ void Graphic3d_Structure::SetPrimitivesAspect (const Handle(Graphic3d_AspectText
|
|||||||
MyCStructure.ContextText.ColorSubTitle.b = float (Bs);
|
MyCStructure.ContextText.ColorSubTitle.b = float (Bs);
|
||||||
MyCStructure.ContextText.TextZoomable = ATextZoomable;
|
MyCStructure.ContextText.TextZoomable = ATextZoomable;
|
||||||
MyCStructure.ContextText.TextAngle = float (ATextAngle);
|
MyCStructure.ContextText.TextAngle = float (ATextAngle);
|
||||||
MyCStructure.ContextText.TextFontAspect = (int)ATextFontAspect;
|
MyCStructure.ContextText.TextFontAspect = int (ATextFontAspect);
|
||||||
|
|
||||||
MyCStructure.ContextText.IsDef = 1;
|
MyCStructure.ContextText.IsDef = 1;
|
||||||
|
|
||||||
@ -1743,13 +1730,6 @@ void Graphic3d_Structure::MinMaxValues (Standard_Real& XMin, Standard_Real& YMin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Graphic3d_Structure::GroupLabels (Standard_Integer& LB, Standard_Integer& LE) {
|
|
||||||
|
|
||||||
LB = MyGroupGenId.Next ();
|
|
||||||
LE = MyGroupGenId.Next ();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Integer Graphic3d_Structure::Identification () const {
|
Standard_Integer Graphic3d_Structure::Identification () const {
|
||||||
|
|
||||||
Standard_Integer Result = MyCStructure.Id;
|
Standard_Integer Result = MyCStructure.Id;
|
||||||
@ -1842,20 +1822,14 @@ void Graphic3d_Structure::Remove (const Standard_Address APtr, const Graphic3d_T
|
|||||||
|
|
||||||
void Graphic3d_Structure::Remove (const Handle(Graphic3d_Group)& AGroup) {
|
void Graphic3d_Structure::Remove (const Handle(Graphic3d_Group)& AGroup) {
|
||||||
|
|
||||||
Standard_Integer index = 0;
|
const Standard_Integer Length = MyGroups.Length ();
|
||||||
Standard_Integer Length = MyGroups.Length ();
|
|
||||||
for (Standard_Integer i=1; i<=Length && index==0; i++)
|
|
||||||
if (MyGroups.Value (i) == AGroup) index = i;
|
|
||||||
|
|
||||||
// Search in Groups
|
// Search in Groups
|
||||||
if (index != 0) {
|
for (Standard_Integer i=1; i<=Length; i++)
|
||||||
Standard_Integer GroupLabelBegin, GroupLabelEnd;
|
if (MyGroups.Value (i) == AGroup)
|
||||||
AGroup->Labels (GroupLabelBegin, GroupLabelEnd);
|
{
|
||||||
MyGroupGenId.Free (GroupLabelBegin);
|
MyGroups.Remove (i);
|
||||||
MyGroupGenId.Free (GroupLabelEnd);
|
return;
|
||||||
MyGroups.Remove (index);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Handle(Graphic3d_StructureManager) Graphic3d_Structure::StructureManager () const {
|
Handle(Graphic3d_StructureManager) Graphic3d_Structure::StructureManager () const {
|
||||||
@ -1887,11 +1861,11 @@ void Graphic3d_Structure::MinMaxCoord (Standard_Real& XMin, Standard_Real& YMin,
|
|||||||
(MyGroups.Value (i))->MinMaxValues(Xm, Ym, Zm, XM, YM, ZM);
|
(MyGroups.Value (i))->MinMaxValues(Xm, Ym, Zm, XM, YM, ZM);
|
||||||
Graphic3d_Vertex vertex1(Xm, Ym, Zm);
|
Graphic3d_Vertex vertex1(Xm, Ym, Zm);
|
||||||
Graphic3d_Vertex vertex2(XM, YM, ZM);
|
Graphic3d_Vertex vertex2(XM, YM, ZM);
|
||||||
Standard_Real distance = vertex1.Distance( vertex1,vertex2 );
|
const Standard_Real distance = vertex1.Distance( vertex2 );
|
||||||
if( distance >= 500000.0){
|
if( distance >= 500000.0){
|
||||||
XMin = XMax = (Xm+ XM)/2.0;
|
XMin = XMax = 0.5*(Xm+ XM);
|
||||||
YMin = YMax = (Ym+ YM)/2.0;
|
YMin = YMax = 0.5*(Ym+ YM);
|
||||||
ZMin = ZMax = (Zm+ ZM)/2.0;
|
ZMin = ZMax = 0.5*(Zm+ ZM);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2144,7 +2118,7 @@ void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)&
|
|||||||
MyCStructure.ContextText.ColorSubTitle.b = float (Bs);
|
MyCStructure.ContextText.ColorSubTitle.b = float (Bs);
|
||||||
MyCStructure.ContextText.TextZoomable = ATextZoomable;
|
MyCStructure.ContextText.TextZoomable = ATextZoomable;
|
||||||
MyCStructure.ContextText.TextAngle = float (ATextAngle);
|
MyCStructure.ContextText.TextAngle = float (ATextAngle);
|
||||||
MyCStructure.ContextText.TextFontAspect = (int)ATextFontAspect;
|
MyCStructure.ContextText.TextFontAspect = int (ATextFontAspect);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -2323,8 +2297,8 @@ void Graphic3d_Structure::UpdateStructure (const Handle(Graphic3d_AspectLine3d)&
|
|||||||
Standard_ShortReal aPolyFactor, aPolyUnits;
|
Standard_ShortReal aPolyFactor, aPolyUnits;
|
||||||
CTXF->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits);
|
CTXF->PolygonOffsets(aPolyMode, aPolyFactor, aPolyUnits);
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetMode = aPolyMode;
|
MyCStructure.ContextFillArea.PolygonOffsetMode = aPolyMode;
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetFactor = aPolyFactor;
|
MyCStructure.ContextFillArea.PolygonOffsetFactor = (Standard_ShortReal)aPolyFactor;
|
||||||
MyCStructure.ContextFillArea.PolygonOffsetUnits = aPolyUnits;
|
MyCStructure.ContextFillArea.PolygonOffsetUnits = (Standard_ShortReal)aPolyUnits;
|
||||||
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
// OCC4895 SAN 22/03/04 High-level interface for controlling polygon offsets
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,12 +49,6 @@
|
|||||||
|
|
||||||
#include <Graphic3d_Group.pxx>
|
#include <Graphic3d_Group.pxx>
|
||||||
|
|
||||||
// check the value of Group_IDMIN (must be > last label value)
|
|
||||||
// (today Structure_LABCONNECT)
|
|
||||||
#define Structure_GROUPBEGIN Group_IDMIN-2
|
|
||||||
#define Structure_GROUPEND Group_IDMIN-1
|
|
||||||
#define Structure_END Group_IDMIN-1
|
|
||||||
|
|
||||||
#define MyStructureManager ((Graphic3d_StructureManager*) MyPtrStructureManager)
|
#define MyStructureManager ((Graphic3d_StructureManager*) MyPtrStructureManager)
|
||||||
#define MyFirstStructureManager ((Graphic3d_StructureManager*) MyFirstPtrStructureManager)
|
#define MyFirstStructureManager ((Graphic3d_StructureManager*) MyFirstPtrStructureManager)
|
||||||
|
|
||||||
|
@ -72,17 +72,11 @@ MyNorme (Standard_ShortReal (Graphic3d_Vector::NormeOf (AX, AY, AZ))) {
|
|||||||
|
|
||||||
Graphic3d_Vector::Graphic3d_Vector (const Graphic3d_Vertex& APoint1, const Graphic3d_Vertex& APoint2) {
|
Graphic3d_Vector::Graphic3d_Vector (const Graphic3d_Vertex& APoint1, const Graphic3d_Vertex& APoint2) {
|
||||||
|
|
||||||
Standard_Real X1, Y1, Z1;
|
MyX = APoint2.X() - APoint1.X();
|
||||||
Standard_Real X2, Y2, Z2;
|
MyY = APoint2.Y() - APoint1.Y();
|
||||||
|
MyZ = APoint2.Z() - APoint1.Z();
|
||||||
|
|
||||||
APoint1.Coord (X1, Y1, Z1);
|
MyNorme = Standard_ShortReal (Graphic3d_Vector::NormeOf (MyX, MyY, MyZ));
|
||||||
APoint2.Coord (X2, Y2, Z2);
|
|
||||||
|
|
||||||
MyX = Standard_ShortReal (X2 - X1);
|
|
||||||
MyY = Standard_ShortReal (Y2 - Y1);
|
|
||||||
MyZ = Standard_ShortReal (Z2 - Z1);
|
|
||||||
|
|
||||||
MyNorme = Standard_ShortReal (Graphic3d_Vector::NormeOf (X2 - X1, Y2 - Y1, Z2 - Z1));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,140 +0,0 @@
|
|||||||
-- Created by: NW,JPB,CAL
|
|
||||||
-- Copyright (c) 1991-1999 Matra Datavision
|
|
||||||
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
||||||
--
|
|
||||||
-- The content of this file is subject to the Open CASCADE Technology Public
|
|
||||||
-- License Version 6.5 (the "License"). You may not use the content of this file
|
|
||||||
-- except in compliance with the License. Please obtain a copy of the License
|
|
||||||
-- at http://www.opencascade.org and read it completely before using this file.
|
|
||||||
--
|
|
||||||
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
||||||
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
||||||
--
|
|
||||||
-- The Original Code and all software distributed under the License is
|
|
||||||
-- distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
||||||
-- Initial Developer hereby disclaims all such warranties, including without
|
|
||||||
-- limitation, any warranties of merchantability, fitness for a particular
|
|
||||||
-- purpose or non-infringement. Please see the License for the specific terms
|
|
||||||
-- and conditions governing the rights and limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
class Vertex from Graphic3d
|
|
||||||
|
|
||||||
---Purpose: This class allows the creation and update of a
|
|
||||||
-- 3D point.
|
|
||||||
|
|
||||||
is
|
|
||||||
|
|
||||||
Create
|
|
||||||
returns Vertex from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point with 0.0, 0.0, 0.0 coordinates.
|
|
||||||
|
|
||||||
Create ( APoint : Vertex from Graphic3d )
|
|
||||||
returns Vertex from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point with coordinates identical to <APoint>.
|
|
||||||
--
|
|
||||||
-- It's just a copy, but this simplifies the management
|
|
||||||
-- of the constructors of VertexC, VertexN and VertexNC.
|
|
||||||
|
|
||||||
Create ( AX, AY ,AZ : Real from Standard )
|
|
||||||
returns Vertex from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point with <AX>, <AY> and <AZ> coordinates.
|
|
||||||
|
|
||||||
---------------------------------------------------
|
|
||||||
-- Category: Methods to modify the class definition
|
|
||||||
---------------------------------------------------
|
|
||||||
|
|
||||||
SetCoord ( me : in out;
|
|
||||||
Xnew, Ynew, Znew : Real from Standard )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Modifies the coordinates of the point <me>.
|
|
||||||
---Category: Methods to modify the class definition
|
|
||||||
|
|
||||||
SetXCoord ( me : in out;
|
|
||||||
Xnew : Real from Standard )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Modifies the X coordinate of the point <me>.
|
|
||||||
---Category: Methods to modify the class definition
|
|
||||||
|
|
||||||
SetYCoord ( me : in out;
|
|
||||||
Ynew : Real from Standard )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Modifies the Y coordinate of the point <me>.
|
|
||||||
---Category: Methods to modify the class definition
|
|
||||||
|
|
||||||
SetZCoord ( me : in out;
|
|
||||||
Znew : Real from Standard )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Modifies the Z coordinate of the point <me>.
|
|
||||||
---Category: Methods to modify the class definition
|
|
||||||
|
|
||||||
----------------------------
|
|
||||||
-- Category: Inquire methods
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
Coord ( me;
|
|
||||||
AX, AY, AZ : out Real from Standard )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns the coordinates of the point <me>.
|
|
||||||
---Category: Inquire methods
|
|
||||||
|
|
||||||
X ( me )
|
|
||||||
returns Real from Standard
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns the X coordinates of the point <me>.
|
|
||||||
---Category: Inquire methods
|
|
||||||
|
|
||||||
Y ( me )
|
|
||||||
returns Real from Standard
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns the Y coordinate of the point <me>.
|
|
||||||
---Category: Inquire methods
|
|
||||||
|
|
||||||
Z ( me )
|
|
||||||
returns Real from Standard
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns the Z coordinate of the point <me>.
|
|
||||||
---Category: Inquire methods
|
|
||||||
|
|
||||||
--------------------------
|
|
||||||
-- Category: Class methods
|
|
||||||
--------------------------
|
|
||||||
|
|
||||||
Distance ( myclass;
|
|
||||||
AV1 : Vertex from Graphic3d;
|
|
||||||
AV2 : Vertex from Graphic3d )
|
|
||||||
returns Real from Standard;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns the distance between <AV1> and <AV2>.
|
|
||||||
---Category: Class methods
|
|
||||||
|
|
||||||
--
|
|
||||||
|
|
||||||
fields
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Class : Graphic3d_Vertex
|
|
||||||
--
|
|
||||||
-- Purpose : Declaration of variables specific to points
|
|
||||||
--
|
|
||||||
-- Reminder : A point is defined by its coordinates
|
|
||||||
--
|
|
||||||
--
|
|
||||||
|
|
||||||
-- the coordinates of a point
|
|
||||||
MyX : ShortReal from Standard;
|
|
||||||
MyY : ShortReal from Standard;
|
|
||||||
MyZ : ShortReal from Standard;
|
|
||||||
|
|
||||||
end Vertex;
|
|
@ -17,114 +17,11 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
#include <Graphic3d_Vertex.hxx>
|
||||||
|
|
||||||
|
Standard_ShortReal Graphic3d_Vertex::Distance(const Graphic3d_Vertex& AOther) const
|
||||||
|
{
|
||||||
//-Version
|
return sqrt( (X() - AOther.X()) * (X() - AOther.X())
|
||||||
|
+ (Y() - AOther.Y()) * (Y() - AOther.Y())
|
||||||
//-Design Declaration des variables specifiques aux points
|
+ (Z() - AOther.Z()) * (Z() - AOther.Z()) );
|
||||||
|
|
||||||
//-Warning Un point est defini par ses coordonnees
|
|
||||||
|
|
||||||
//-References
|
|
||||||
|
|
||||||
//-Language C++ 2.0
|
|
||||||
|
|
||||||
//-Declarations
|
|
||||||
|
|
||||||
// for the class
|
|
||||||
#include <Graphic3d_Vertex.ixx>
|
|
||||||
|
|
||||||
//-Aliases
|
|
||||||
|
|
||||||
//-Global data definitions
|
|
||||||
|
|
||||||
// -- les coordonnees du point
|
|
||||||
// MyX : Standard_ShortReal;
|
|
||||||
// MyY : Standard_ShortReal;
|
|
||||||
// MyZ : Standard_ShortReal;
|
|
||||||
|
|
||||||
//-Constructors
|
|
||||||
|
|
||||||
//-Destructors
|
|
||||||
|
|
||||||
//-Methods, in order
|
|
||||||
|
|
||||||
Graphic3d_Vertex::Graphic3d_Vertex ():
|
|
||||||
MyX (Standard_ShortReal (0.0)),
|
|
||||||
MyY (Standard_ShortReal (0.0)),
|
|
||||||
MyZ (Standard_ShortReal (0.0)) {
|
|
||||||
}
|
|
||||||
|
|
||||||
Graphic3d_Vertex::Graphic3d_Vertex (const Graphic3d_Vertex& P) {
|
|
||||||
|
|
||||||
MyX = Standard_ShortReal (P.X ());
|
|
||||||
MyY = Standard_ShortReal (P.Y ());
|
|
||||||
MyZ = Standard_ShortReal (P.Z ());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Graphic3d_Vertex::Graphic3d_Vertex (const Standard_Real AX, const Standard_Real AY, const Standard_Real AZ):
|
|
||||||
MyX (Standard_ShortReal (AX)),
|
|
||||||
MyY (Standard_ShortReal (AY)),
|
|
||||||
MyZ (Standard_ShortReal (AZ)) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Vertex::Coord (Standard_Real& X, Standard_Real& Y, Standard_Real& Z) const {
|
|
||||||
|
|
||||||
X = Standard_Real (MyX);
|
|
||||||
Y = Standard_Real (MyY);
|
|
||||||
Z = Standard_Real (MyZ);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Real Graphic3d_Vertex::X () const {
|
|
||||||
|
|
||||||
return Standard_Real (MyX);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Real Graphic3d_Vertex::Y () const {
|
|
||||||
|
|
||||||
return Standard_Real (MyY);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Real Graphic3d_Vertex::Z () const {
|
|
||||||
|
|
||||||
return Standard_Real (MyZ);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Vertex::SetCoord (const Standard_Real Xnew, const Standard_Real Ynew, const Standard_Real Znew) {
|
|
||||||
|
|
||||||
MyX = Standard_ShortReal (Xnew);
|
|
||||||
MyY = Standard_ShortReal (Ynew);
|
|
||||||
MyZ = Standard_ShortReal (Znew);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Vertex::SetXCoord (const Standard_Real Xnew) {
|
|
||||||
|
|
||||||
MyX = Standard_ShortReal (Xnew);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Vertex::SetYCoord (const Standard_Real Ynew) {
|
|
||||||
|
|
||||||
MyY = Standard_ShortReal (Ynew);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_Vertex::SetZCoord (const Standard_Real Znew) {
|
|
||||||
|
|
||||||
MyZ = Standard_ShortReal (Znew);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Standard_Real Graphic3d_Vertex::Distance (const Graphic3d_Vertex& AV1, const Graphic3d_Vertex& AV2) {
|
|
||||||
|
|
||||||
return (Sqrt ( (AV1.X () - AV2.X ()) * (AV1.X () - AV2.X ())
|
|
||||||
+ (AV1.Y () - AV2.Y ()) * (AV1.Y () - AV2.Y ())
|
|
||||||
+ (AV1.Z () - AV2.Z ()) * (AV1.Z () - AV2.Z ())));
|
|
||||||
}
|
}
|
||||||
|
66
src/Graphic3d/Graphic3d_Vertex.hxx
Normal file
66
src/Graphic3d/Graphic3d_Vertex.hxx
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
// Created on: 2012-06-20
|
||||||
|
// Created by: Sergey ZERCHANINOV
|
||||||
|
// Copyright (c) 2011-2012 OPEN CASCADE SAS
|
||||||
|
//
|
||||||
|
// The content of this file is subject to the Open CASCADE Technology Public
|
||||||
|
// License Version 6.5 (the "License"). You may not use the content of this file
|
||||||
|
// except in compliance with the License. Please obtain a copy of the License
|
||||||
|
// at http://www.opencascade.org and read it completely before using this file.
|
||||||
|
//
|
||||||
|
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
||||||
|
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
||||||
|
//
|
||||||
|
// The Original Code and all software distributed under the License is
|
||||||
|
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
||||||
|
// Initial Developer hereby disclaims all such warranties, including without
|
||||||
|
// limitation, any warranties of merchantability, fitness for a particular
|
||||||
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
#ifndef _Graphic3d_Vertex_HeaderFile
|
||||||
|
#define _Graphic3d_Vertex_HeaderFile
|
||||||
|
|
||||||
|
#include <Standard_Macro.hxx>
|
||||||
|
#include <InterfaceGraphic_telem.hxx>
|
||||||
|
#include <Standard_ShortReal.hxx>
|
||||||
|
#include <Standard_Real.hxx>
|
||||||
|
|
||||||
|
//! This class represents a graphical 3D point. <br>
|
||||||
|
class Graphic3d_Vertex : public TEL_POINT
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
//! Creates a point with 0.0, 0.0, 0.0 coordinates. <br>
|
||||||
|
Graphic3d_Vertex()
|
||||||
|
{ SetCoord(0.f,0.f,0.f); }
|
||||||
|
//! Creates a point with coordinates identical to <APoint>. <br>
|
||||||
|
Graphic3d_Vertex(const Graphic3d_Vertex& APoint)
|
||||||
|
{ SetCoord(APoint.X(),APoint.Y(),APoint.Z()); }
|
||||||
|
//! Creates a point with <AX>, <AY> and <AZ> coordinates. <br>
|
||||||
|
Graphic3d_Vertex(const Standard_ShortReal AX,const Standard_ShortReal AY,const Standard_ShortReal AZ)
|
||||||
|
{ SetCoord(AX,AY,AZ); }
|
||||||
|
//! Creates a point with <AX>, <AY> and <AZ> coordinates. <br>
|
||||||
|
Graphic3d_Vertex(const Standard_Real AX,const Standard_Real AY,const Standard_Real AZ)
|
||||||
|
{ SetCoord(AX,AY,AZ); }
|
||||||
|
//! Modifies the coordinates of the point <me>. <br>
|
||||||
|
void SetCoord(const Standard_ShortReal AX,const Standard_ShortReal AY,const Standard_ShortReal AZ)
|
||||||
|
{ xyz[0] = AX, xyz[1] = AY, xyz[2] = AZ; }
|
||||||
|
//! Modifies the coordinates of the point <me>. <br>
|
||||||
|
void SetCoord(const Standard_Real AX,const Standard_Real AY,const Standard_Real AZ)
|
||||||
|
{ xyz[0] = Standard_ShortReal(AX), xyz[1] = Standard_ShortReal(AY), xyz[2] = Standard_ShortReal(AZ); }
|
||||||
|
//! Returns the coordinates of the point <me>. <br>
|
||||||
|
void Coord(Standard_ShortReal& AX,Standard_ShortReal& AY,Standard_ShortReal& AZ) const
|
||||||
|
{ AX = xyz[0], AY = xyz[1], AZ = xyz[2]; }
|
||||||
|
//! Returns the coordinates of the point <me>. <br>
|
||||||
|
void Coord(Standard_Real& AX,Standard_Real& AY,Standard_Real& AZ) const
|
||||||
|
{ AX = xyz[0], AY = xyz[1], AZ = xyz[2]; }
|
||||||
|
//! Returns the X coordinates of the point <me>. <br>
|
||||||
|
Standard_ShortReal X() const { return xyz[0]; }
|
||||||
|
//! Returns the Y coordinate of the point <me>. <br>
|
||||||
|
Standard_ShortReal Y() const { return xyz[1]; }
|
||||||
|
//! Returns the Z coordinate of the point <me>. <br>
|
||||||
|
Standard_ShortReal Z() const { return xyz[2]; }
|
||||||
|
//! Returns the distance between <AV1> and <AV2>. <br>
|
||||||
|
Standard_EXPORT Standard_ShortReal Distance(const Graphic3d_Vertex& AOther) const;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -1,94 +0,0 @@
|
|||||||
-- Created by: NW,JPB,CAL
|
|
||||||
-- Copyright (c) 1991-1999 Matra Datavision
|
|
||||||
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
||||||
--
|
|
||||||
-- The content of this file is subject to the Open CASCADE Technology Public
|
|
||||||
-- License Version 6.5 (the "License"). You may not use the content of this file
|
|
||||||
-- except in compliance with the License. Please obtain a copy of the License
|
|
||||||
-- at http://www.opencascade.org and read it completely before using this file.
|
|
||||||
--
|
|
||||||
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
||||||
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
||||||
--
|
|
||||||
-- The Original Code and all software distributed under the License is
|
|
||||||
-- distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
||||||
-- Initial Developer hereby disclaims all such warranties, including without
|
|
||||||
-- limitation, any warranties of merchantability, fitness for a particular
|
|
||||||
-- purpose or non-infringement. Please see the License for the specific terms
|
|
||||||
-- and conditions governing the rights and limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
class VertexC from Graphic3d inherits Vertex from Graphic3d
|
|
||||||
|
|
||||||
---Version:
|
|
||||||
|
|
||||||
---Purpose: This class allows the creation and update of a point
|
|
||||||
-- with a colour value.
|
|
||||||
|
|
||||||
---Keywords: Vertex, Color, Coordinate, Point
|
|
||||||
|
|
||||||
---Warning:
|
|
||||||
---References:
|
|
||||||
|
|
||||||
uses
|
|
||||||
|
|
||||||
Color from Quantity
|
|
||||||
---Purpose: Returns the color of this point.
|
|
||||||
is
|
|
||||||
|
|
||||||
Create
|
|
||||||
returns VertexC from Graphic3d;
|
|
||||||
---Purpose: Constructs an empty point
|
|
||||||
|
|
||||||
Create ( AX, AY ,AZ : Real from Standard;
|
|
||||||
AColor : Color from Quantity )
|
|
||||||
returns VertexC from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point with coordinates <AX>, <AY>, <AZ> and
|
|
||||||
-- with colour <AColor>.
|
|
||||||
|
|
||||||
Create ( APoint : Vertex from Graphic3d;
|
|
||||||
AColor : Color from Quantity )
|
|
||||||
returns VertexC from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point situated in <APoint> and
|
|
||||||
-- for which the colour is <AColor>.
|
|
||||||
|
|
||||||
---------------------------------------------------
|
|
||||||
-- Category: Methods to modify the class definition
|
|
||||||
---------------------------------------------------
|
|
||||||
|
|
||||||
SetColor ( me : in out;
|
|
||||||
ColorNew : Color from Quantity )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Modifies the colour of the point <me>.
|
|
||||||
---Category: Methods to modify the class definition
|
|
||||||
|
|
||||||
----------------------------
|
|
||||||
-- Category: Inquire methods
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
Color ( me )
|
|
||||||
returns Color from Quantity
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns the colour of the point <me>.
|
|
||||||
---Category: Inquire methods
|
|
||||||
|
|
||||||
--
|
|
||||||
|
|
||||||
fields
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Class : Graphic3d_VertexC
|
|
||||||
--
|
|
||||||
-- Purpose : Declaration of variables specific to points
|
|
||||||
--
|
|
||||||
-- Reminder : a point is defined by its coordinates and its colour
|
|
||||||
--
|
|
||||||
|
|
||||||
-- the colour of a point
|
|
||||||
MyColor : Color from Quantity;
|
|
||||||
|
|
||||||
end VertexC;
|
|
@ -1,80 +0,0 @@
|
|||||||
// Created by: NW,JPB,CAL
|
|
||||||
// Copyright (c) 1991-1999 Matra Datavision
|
|
||||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
||||||
//
|
|
||||||
// The content of this file is subject to the Open CASCADE Technology Public
|
|
||||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
|
||||||
// except in compliance with the License. Please obtain a copy of the License
|
|
||||||
// at http://www.opencascade.org and read it completely before using this file.
|
|
||||||
//
|
|
||||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
||||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
||||||
//
|
|
||||||
// The Original Code and all software distributed under the License is
|
|
||||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
||||||
// Initial Developer hereby disclaims all such warranties, including without
|
|
||||||
// limitation, any warranties of merchantability, fitness for a particular
|
|
||||||
// purpose or non-infringement. Please see the License for the specific terms
|
|
||||||
// and conditions governing the rights and limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-Version
|
|
||||||
|
|
||||||
//-Design Declaration of variables specific to points
|
|
||||||
|
|
||||||
//-Warning A point is defined by its coordinates and color
|
|
||||||
|
|
||||||
//-References
|
|
||||||
|
|
||||||
//-Language C++ 2.0
|
|
||||||
|
|
||||||
//-Declarations
|
|
||||||
|
|
||||||
// for the class
|
|
||||||
#include <Graphic3d_VertexC.ixx>
|
|
||||||
|
|
||||||
//-Aliases
|
|
||||||
|
|
||||||
//-Global data definitions
|
|
||||||
|
|
||||||
// -- point color
|
|
||||||
// MyColor : Color;
|
|
||||||
|
|
||||||
//-Constructors
|
|
||||||
|
|
||||||
//-Destructors
|
|
||||||
|
|
||||||
//-Methods, in order
|
|
||||||
|
|
||||||
Graphic3d_VertexC::Graphic3d_VertexC () {
|
|
||||||
}
|
|
||||||
|
|
||||||
// :(AX, AY, AZ) as VertexC inherits Vertex and it is necessary to call
|
|
||||||
// constructor of Vertex with AX, AY and AZ to update fields MyX, MyY, MyZ.
|
|
||||||
|
|
||||||
Graphic3d_VertexC::Graphic3d_VertexC (const Standard_Real AX, const Standard_Real AY, const Standard_Real AZ, const Quantity_Color& AColor):
|
|
||||||
Graphic3d_Vertex (AX, AY, AZ),
|
|
||||||
MyColor (AColor) {
|
|
||||||
}
|
|
||||||
|
|
||||||
// :(APoint) as VertexC inherits Vertex and it is necessary to call
|
|
||||||
// constructor of Vertex with APoint to update fields MyX, MyY, MyZ.
|
|
||||||
|
|
||||||
Graphic3d_VertexC::Graphic3d_VertexC (const Graphic3d_Vertex& APoint, const Quantity_Color& AColor):
|
|
||||||
Graphic3d_Vertex (APoint),
|
|
||||||
MyColor (AColor) {
|
|
||||||
}
|
|
||||||
|
|
||||||
Quantity_Color Graphic3d_VertexC::Color () const {
|
|
||||||
|
|
||||||
return (MyColor);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_VertexC::SetColor (const Quantity_Color& ColorNew) {
|
|
||||||
|
|
||||||
MyColor = ColorNew;
|
|
||||||
|
|
||||||
}
|
|
@ -1,106 +0,0 @@
|
|||||||
-- Created by: NW,JPB,CAL
|
|
||||||
-- Copyright (c) 1991-1999 Matra Datavision
|
|
||||||
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
||||||
--
|
|
||||||
-- The content of this file is subject to the Open CASCADE Technology Public
|
|
||||||
-- License Version 6.5 (the "License"). You may not use the content of this file
|
|
||||||
-- except in compliance with the License. Please obtain a copy of the License
|
|
||||||
-- at http://www.opencascade.org and read it completely before using this file.
|
|
||||||
--
|
|
||||||
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
||||||
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
||||||
--
|
|
||||||
-- The Original Code and all software distributed under the License is
|
|
||||||
-- distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
||||||
-- Initial Developer hereby disclaims all such warranties, including without
|
|
||||||
-- limitation, any warranties of merchantability, fitness for a particular
|
|
||||||
-- purpose or non-infringement. Please see the License for the specific terms
|
|
||||||
-- and conditions governing the rights and limitations under the License.
|
|
||||||
|
|
||||||
-- Modified: 03-02-98 : FMN ; Add Flag Normal
|
|
||||||
|
|
||||||
class VertexN from Graphic3d inherits Vertex from Graphic3d
|
|
||||||
|
|
||||||
---Version:
|
|
||||||
|
|
||||||
---Purpose: This class allows the creation and update of
|
|
||||||
-- a vertex with a 3D normal.
|
|
||||||
|
|
||||||
---Keywords: Vertex, Normal, Coordinate, Point
|
|
||||||
|
|
||||||
---Warning:
|
|
||||||
---References:
|
|
||||||
|
|
||||||
uses
|
|
||||||
|
|
||||||
Vector from Graphic3d
|
|
||||||
|
|
||||||
is
|
|
||||||
|
|
||||||
Create
|
|
||||||
returns VertexN from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point with 0.0, 0.0, 0.0 coordinates
|
|
||||||
-- for which the normal is 0.0, 0.0, 1.0.
|
|
||||||
|
|
||||||
Create ( AX, AY, AZ : Real from Standard;
|
|
||||||
ANX, ANY, ANZ : Real from Standard;
|
|
||||||
FlagNormalise : Boolean from Standard = Standard_True )
|
|
||||||
returns VertexN from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point with coordinates <AX>, <AY>, <AZ> and
|
|
||||||
-- for which the normal is <ANX>, <ANY>, <ANZ>.
|
|
||||||
-- If <FlagNormalise> is True the normal is already normalised
|
|
||||||
-- Else the normal is not normalised, the graphic do it.
|
|
||||||
|
|
||||||
Create ( APoint : Vertex from Graphic3d;
|
|
||||||
AVector : Vector from Graphic3d;
|
|
||||||
FlagNormalise : Boolean from Standard = Standard_True )
|
|
||||||
returns VertexN from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point in <APoint> for which the normal is <AVector>.
|
|
||||||
-- If <FlagNormalise> is True the normal is already normalised
|
|
||||||
-- Else the normal is not normalised, the graphic do it.
|
|
||||||
|
|
||||||
---------------------------------------------------
|
|
||||||
-- Category: Methods to modify the class definition
|
|
||||||
---------------------------------------------------
|
|
||||||
|
|
||||||
SetNormal ( me : in out;
|
|
||||||
NXnew, NYnew, NZnew : Real from Standard;
|
|
||||||
FlagNormalise : Boolean from Standard = Standard_True )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Modifies the normal to the point <me>.
|
|
||||||
-- If <FlagNormalise> is True the normal is already normalised
|
|
||||||
-- Else the normal is not normalised, the graphic do it.
|
|
||||||
---Category: Methods to modify the class definition
|
|
||||||
|
|
||||||
----------------------------
|
|
||||||
-- Category: Inquire methods
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
Normal ( me;
|
|
||||||
ANX, ANY, ANZ : out Real from Standard )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns the normal to the point <me>.
|
|
||||||
---Category: Inquire methods
|
|
||||||
|
|
||||||
--
|
|
||||||
|
|
||||||
fields
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Class : Graphic3d_VertexN
|
|
||||||
--
|
|
||||||
-- Purpose : Declaration of variables specific to points.
|
|
||||||
--
|
|
||||||
-- Reminder : A point is defined by its coordinates and its normal.
|
|
||||||
|
|
||||||
-- the normale to the point
|
|
||||||
MyDX : ShortReal from Standard;
|
|
||||||
MyDY : ShortReal from Standard;
|
|
||||||
MyDZ : ShortReal from Standard;
|
|
||||||
|
|
||||||
end VertexN;
|
|
@ -1,84 +0,0 @@
|
|||||||
// Created by: NW,JPB,CAL
|
|
||||||
// Copyright (c) 1991-1999 Matra Datavision
|
|
||||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
||||||
//
|
|
||||||
// The content of this file is subject to the Open CASCADE Technology Public
|
|
||||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
|
||||||
// except in compliance with the License. Please obtain a copy of the License
|
|
||||||
// at http://www.opencascade.org and read it completely before using this file.
|
|
||||||
//
|
|
||||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
||||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
||||||
//
|
|
||||||
// The Original Code and all software distributed under the License is
|
|
||||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
||||||
// Initial Developer hereby disclaims all such warranties, including without
|
|
||||||
// limitation, any warranties of merchantability, fitness for a particular
|
|
||||||
// purpose or non-infringement. Please see the License for the specific terms
|
|
||||||
// and conditions governing the rights and limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
// Modified: 03-02-98 : FMN ; Add Flag Normal
|
|
||||||
// Modified: 15-09-98 : CAL ; Modification champ definissant la normale
|
|
||||||
// pour permettre l'entrelacement des coordonnees dans Optimizer.
|
|
||||||
|
|
||||||
|
|
||||||
//-Version
|
|
||||||
|
|
||||||
//-Design Declaration des variables specifiques aux points
|
|
||||||
|
|
||||||
//-Warning Un point est defini par ses coordonnees et sa normale
|
|
||||||
|
|
||||||
//-References
|
|
||||||
|
|
||||||
//-Language C++ 2.0
|
|
||||||
|
|
||||||
//-Declarations
|
|
||||||
|
|
||||||
// for the class
|
|
||||||
#include <Graphic3d_VertexN.ixx>
|
|
||||||
|
|
||||||
//-Aliases
|
|
||||||
|
|
||||||
//-Global data definitions
|
|
||||||
|
|
||||||
//-Constructors
|
|
||||||
|
|
||||||
//-Destructors
|
|
||||||
|
|
||||||
//-Methods, in order
|
|
||||||
|
|
||||||
Graphic3d_VertexN::Graphic3d_VertexN ():
|
|
||||||
Graphic3d_Vertex (0.0, 0.0, 0.0) {
|
|
||||||
MyDX = 0.0,
|
|
||||||
MyDY = 0.0,
|
|
||||||
MyDZ = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Graphic3d_VertexN::Graphic3d_VertexN (const Standard_Real AX, const Standard_Real AY, const Standard_Real AZ, const Standard_Real ANX, const Standard_Real ANY, const Standard_Real ANZ, const Standard_Boolean FlagNormalise):
|
|
||||||
Graphic3d_Vertex (AX, AY, AZ) {
|
|
||||||
MyDX = (Standard_ShortReal ) ANX,
|
|
||||||
MyDY = (Standard_ShortReal ) ANY,
|
|
||||||
MyDZ = (Standard_ShortReal ) ANZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
Graphic3d_VertexN::Graphic3d_VertexN (const Graphic3d_Vertex& APoint, const Graphic3d_Vector& AVector, const Standard_Boolean FlagNormalise):
|
|
||||||
Graphic3d_Vertex (APoint) {
|
|
||||||
Standard_Real ANX, ANY, ANZ;
|
|
||||||
AVector.Coord (ANX, ANY, ANZ);
|
|
||||||
MyDX = (Standard_ShortReal ) ANX,
|
|
||||||
MyDY = (Standard_ShortReal ) ANY,
|
|
||||||
MyDZ = (Standard_ShortReal ) ANZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_VertexN::SetNormal (const Standard_Real ANX, const Standard_Real ANY, const Standard_Real ANZ, const Standard_Boolean FlagNormalise) {
|
|
||||||
MyDX = (Standard_ShortReal ) ANX,
|
|
||||||
MyDY = (Standard_ShortReal ) ANY,
|
|
||||||
MyDZ = (Standard_ShortReal ) ANZ;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_VertexN::Normal (Standard_Real& ANX, Standard_Real& ANY, Standard_Real& ANZ) const {
|
|
||||||
ANX = MyDX,
|
|
||||||
ANY = MyDY,
|
|
||||||
ANZ = MyDZ;
|
|
||||||
}
|
|
@ -1,110 +0,0 @@
|
|||||||
-- Created by: NW,JPB,CAL
|
|
||||||
-- Copyright (c) 1991-1999 Matra Datavision
|
|
||||||
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
||||||
--
|
|
||||||
-- The content of this file is subject to the Open CASCADE Technology Public
|
|
||||||
-- License Version 6.5 (the "License"). You may not use the content of this file
|
|
||||||
-- except in compliance with the License. Please obtain a copy of the License
|
|
||||||
-- at http://www.opencascade.org and read it completely before using this file.
|
|
||||||
--
|
|
||||||
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
||||||
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
||||||
--
|
|
||||||
-- The Original Code and all software distributed under the License is
|
|
||||||
-- distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
||||||
-- Initial Developer hereby disclaims all such warranties, including without
|
|
||||||
-- limitation, any warranties of merchantability, fitness for a particular
|
|
||||||
-- purpose or non-infringement. Please see the License for the specific terms
|
|
||||||
-- and conditions governing the rights and limitations under the License.
|
|
||||||
|
|
||||||
-- Modified: 03-02-98 : FMN ; Add Flag Normal
|
|
||||||
|
|
||||||
class VertexNC from Graphic3d inherits VertexN from Graphic3d
|
|
||||||
|
|
||||||
---Version:
|
|
||||||
|
|
||||||
---Purpose: This class allows the creation of a vertex with
|
|
||||||
-- a colour and a 3D normal.
|
|
||||||
|
|
||||||
---Keywords: Vertex, Normal, Color, Coordinate, Point
|
|
||||||
|
|
||||||
---Warning:
|
|
||||||
---References:
|
|
||||||
|
|
||||||
uses
|
|
||||||
|
|
||||||
Color from Quantity,
|
|
||||||
|
|
||||||
Vector from Graphic3d,
|
|
||||||
Vertex from Graphic3d
|
|
||||||
|
|
||||||
is
|
|
||||||
|
|
||||||
Create
|
|
||||||
returns VertexNC from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point with coordinates 0.0, 0.0, 0.0
|
|
||||||
-- for which the normal is 0.0, 0.0, 1.0 and
|
|
||||||
-- the colour is Quantity_NOC_WHITE.
|
|
||||||
|
|
||||||
Create ( AX, AY, AZ : Real from Standard;
|
|
||||||
ANX, ANY, ANZ : Real from Standard;
|
|
||||||
AColor : Color from Quantity;
|
|
||||||
FlagNormalise : Boolean from Standard = Standard_True )
|
|
||||||
returns VertexNC from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point with coordinates <AX>, <AY>, <AZ>
|
|
||||||
-- for which the normal is <ANX>, <ANY>, <ANZ> and
|
|
||||||
-- the colour is <AColor>.
|
|
||||||
-- If <FlagNormalise> is True the normal is already normalised
|
|
||||||
-- Else the normal is not normalised, the graphic do it.
|
|
||||||
|
|
||||||
Create ( APoint : Vertex from Graphic3d;
|
|
||||||
AVector : Vector from Graphic3d;
|
|
||||||
AColor : Color from Quantity;
|
|
||||||
FlagNormalise : Boolean from Standard = Standard_True )
|
|
||||||
returns VertexNC from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point in <APoint> for which the normal
|
|
||||||
-- is <AVector> and the colour is <AColor>.
|
|
||||||
-- If <FlagNormalise> is True the normal is already normalised
|
|
||||||
-- Else the normal is not normalised, the graphic do it.
|
|
||||||
|
|
||||||
---------------------------------------------------
|
|
||||||
-- Category: Methods to modify the class definition
|
|
||||||
---------------------------------------------------
|
|
||||||
|
|
||||||
SetColor ( me : in out;
|
|
||||||
ColorNew : Color from Quantity )
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Modifies the colour of the point <me>.
|
|
||||||
---Category: Methods to modify the class definition
|
|
||||||
|
|
||||||
----------------------------
|
|
||||||
-- Category: Inquire methods
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
Color ( me )
|
|
||||||
returns Color from Quantity
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns the colour of the point <me>.
|
|
||||||
---Category: Inquire methods
|
|
||||||
|
|
||||||
--
|
|
||||||
|
|
||||||
fields
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Class : Graphic3d_VertexNC
|
|
||||||
--
|
|
||||||
-- Purpose : Declaration of variables specific to points
|
|
||||||
--
|
|
||||||
-- Reminder : A point is defined by its coordinates, its normal
|
|
||||||
-- and its colour.
|
|
||||||
|
|
||||||
-- the colour
|
|
||||||
MyColor : Color from Quantity;
|
|
||||||
|
|
||||||
end VertexNC;
|
|
@ -1,90 +0,0 @@
|
|||||||
// Created by: NW,JPB,CAL
|
|
||||||
// Copyright (c) 1991-1999 Matra Datavision
|
|
||||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
||||||
//
|
|
||||||
// The content of this file is subject to the Open CASCADE Technology Public
|
|
||||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
|
||||||
// except in compliance with the License. Please obtain a copy of the License
|
|
||||||
// at http://www.opencascade.org and read it completely before using this file.
|
|
||||||
//
|
|
||||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
||||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
||||||
//
|
|
||||||
// The Original Code and all software distributed under the License is
|
|
||||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
||||||
// Initial Developer hereby disclaims all such warranties, including without
|
|
||||||
// limitation, any warranties of merchantability, fitness for a particular
|
|
||||||
// purpose or non-infringement. Please see the License for the specific terms
|
|
||||||
// and conditions governing the rights and limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
// Modified: 03-02-98 : FMN ; Add Flag Normal
|
|
||||||
|
|
||||||
|
|
||||||
//-Version
|
|
||||||
|
|
||||||
//-Design Declaration of variables specific to points
|
|
||||||
|
|
||||||
//-Warning A point is defined by its coordinates, normal
|
|
||||||
// and color
|
|
||||||
|
|
||||||
//-References
|
|
||||||
|
|
||||||
//-Language C++ 2.0
|
|
||||||
|
|
||||||
//-Declarations
|
|
||||||
|
|
||||||
// for the class
|
|
||||||
#include <Graphic3d_VertexNC.ixx>
|
|
||||||
|
|
||||||
//-Aliases
|
|
||||||
|
|
||||||
//-Global data definitions
|
|
||||||
|
|
||||||
// -- the color
|
|
||||||
// MyColor : Color;
|
|
||||||
|
|
||||||
//-Constructors
|
|
||||||
|
|
||||||
//-Destructors
|
|
||||||
|
|
||||||
//-Methods, in order
|
|
||||||
|
|
||||||
Graphic3d_VertexNC::Graphic3d_VertexNC ():
|
|
||||||
Graphic3d_VertexN (0.0, 0.0, 0.0, 0.0, 0.0, 1.0) {
|
|
||||||
|
|
||||||
Quantity_Color AColor (Quantity_NOC_WHITE);
|
|
||||||
|
|
||||||
MyColor = AColor;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// :(AX, AY, AZ) as VertexNC inherits VertexN and it is necessary to call
|
|
||||||
// constructor of VertexN with AX, AY, AZ, ANX, ANY and ANZ to
|
|
||||||
// update fields.
|
|
||||||
|
|
||||||
Graphic3d_VertexNC::Graphic3d_VertexNC (const Standard_Real AX, const Standard_Real AY, const Standard_Real AZ, const Standard_Real ANX, const Standard_Real ANY, const Standard_Real ANZ, const Quantity_Color& AColor,const Standard_Boolean FlagNormalise):
|
|
||||||
Graphic3d_VertexN (AX, AY, AZ, ANX, ANY, ANZ,FlagNormalise),
|
|
||||||
MyColor (AColor) {
|
|
||||||
}
|
|
||||||
|
|
||||||
// :(APoint, AVector) as VertexNC inherits VertexN and it is necessary to call
|
|
||||||
// constructor of VertexN with APoint and AVector to
|
|
||||||
// update fields.
|
|
||||||
|
|
||||||
Graphic3d_VertexNC::Graphic3d_VertexNC (const Graphic3d_Vertex& APoint, const Graphic3d_Vector& AVector, const Quantity_Color& AColor,const Standard_Boolean FlagNormalise):
|
|
||||||
Graphic3d_VertexN (APoint, AVector,FlagNormalise),
|
|
||||||
MyColor (AColor) {
|
|
||||||
}
|
|
||||||
|
|
||||||
Quantity_Color Graphic3d_VertexNC::Color () const {
|
|
||||||
|
|
||||||
return (MyColor);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_VertexNC::SetColor (const Quantity_Color& ColorNew) {
|
|
||||||
|
|
||||||
MyColor = ColorNew;
|
|
||||||
|
|
||||||
}
|
|
@ -1,112 +0,0 @@
|
|||||||
-- Created on: 1997-09-27
|
|
||||||
-- Created by: PCT
|
|
||||||
-- Copyright (c) 1997-1999 Matra Datavision
|
|
||||||
-- Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
||||||
--
|
|
||||||
-- The content of this file is subject to the Open CASCADE Technology Public
|
|
||||||
-- License Version 6.5 (the "License"). You may not use the content of this file
|
|
||||||
-- except in compliance with the License. Please obtain a copy of the License
|
|
||||||
-- at http://www.opencascade.org and read it completely before using this file.
|
|
||||||
--
|
|
||||||
-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
||||||
-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
||||||
--
|
|
||||||
-- The Original Code and all software distributed under the License is
|
|
||||||
-- distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
||||||
-- Initial Developer hereby disclaims all such warranties, including without
|
|
||||||
-- limitation, any warranties of merchantability, fitness for a particular
|
|
||||||
-- purpose or non-infringement. Please see the License for the specific terms
|
|
||||||
-- and conditions governing the rights and limitations under the License.
|
|
||||||
|
|
||||||
-- Modified: 03-02-98 : FMN ; Add Flag Normal
|
|
||||||
|
|
||||||
class VertexNT from Graphic3d inherits VertexN from Graphic3d
|
|
||||||
|
|
||||||
---Version:
|
|
||||||
|
|
||||||
---Purpose: This class allows the creation and update of
|
|
||||||
-- a vertex with a 3D normal and texture coordinate.
|
|
||||||
|
|
||||||
---Keywords: Vertex, Normal, Coordinate, Point, Texture
|
|
||||||
|
|
||||||
---Warning:
|
|
||||||
---References:
|
|
||||||
|
|
||||||
uses
|
|
||||||
|
|
||||||
Vector from Graphic3d,
|
|
||||||
Vertex from Graphic3d
|
|
||||||
|
|
||||||
is
|
|
||||||
|
|
||||||
Create
|
|
||||||
returns VertexNT from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point with 0.0, 0.0, 0.0 coordinates
|
|
||||||
-- for which the normal is 0.0, 0.0, 1.0.
|
|
||||||
-- texture coordinate is 0.0, 0.0.
|
|
||||||
|
|
||||||
Create ( AX, AY, AZ : Real from Standard;
|
|
||||||
ANX, ANY, ANZ : Real from Standard;
|
|
||||||
ATX : Real from Standard;
|
|
||||||
ATY : Real from Standard = 0.0;
|
|
||||||
FlagNormalise : Boolean from Standard = Standard_True )
|
|
||||||
returns VertexNT from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point with coordinates <AX>, <AY>, <AZ> and
|
|
||||||
-- for which the normal is <ANX>, <ANY>, <ANZ>,
|
|
||||||
-- texture coordinate is <ATX>, <ATY>.
|
|
||||||
-- If <FlagNormalise> is True the normal is already normalised
|
|
||||||
-- Else the normal is not normalised, the graphic do it.
|
|
||||||
|
|
||||||
Create ( APoint : Vertex from Graphic3d;
|
|
||||||
AVector : Vector from Graphic3d;
|
|
||||||
ATX : Real from Standard;
|
|
||||||
ATY : Real from Standard = 0.0;
|
|
||||||
FlagNormalise : Boolean from Standard = Standard_True )
|
|
||||||
returns VertexNT from Graphic3d;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Creates a point in <APoint> for which the normal is <AVector>.
|
|
||||||
-- <ATX>, <ATY> are texture coordinate.
|
|
||||||
-- If <FlagNormalise> is True the normal is already normalised
|
|
||||||
-- Else the normal is not normalised, the graphic do it.
|
|
||||||
|
|
||||||
---------------------------------------------------
|
|
||||||
-- Category: Methods to modify the class definition
|
|
||||||
---------------------------------------------------
|
|
||||||
|
|
||||||
SetTextureCoordinate( me : in out;
|
|
||||||
ATX : Real from Standard;
|
|
||||||
ATY : Real from Standard = 0.0)
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Modifies the texture coordinate to the point <me>.
|
|
||||||
---Category: Methods to modify the class definition
|
|
||||||
|
|
||||||
|
|
||||||
----------------------------
|
|
||||||
-- Category: Inquire methods
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
TextureCoordinate( me;
|
|
||||||
ATX, ATY : out Real from Standard)
|
|
||||||
is static;
|
|
||||||
---Level: Public
|
|
||||||
---Purpose: Returns the texture coordinate to the point <me>.
|
|
||||||
---Category: Inquire methods
|
|
||||||
|
|
||||||
--
|
|
||||||
|
|
||||||
fields
|
|
||||||
|
|
||||||
--
|
|
||||||
-- Class : Graphic3d_VertexNT
|
|
||||||
--
|
|
||||||
-- Purpose : Declaration of variables specific to points.
|
|
||||||
--
|
|
||||||
-- Reminder : A point is defined by its coordinates and its normal.
|
|
||||||
|
|
||||||
-- the texel
|
|
||||||
MyTX, MyTY : Real from Standard;
|
|
||||||
|
|
||||||
end VertexNT;
|
|
@ -1,81 +0,0 @@
|
|||||||
// Created on: 1997-08-27
|
|
||||||
// Created by: PCT
|
|
||||||
// Copyright (c) 1997-1999 Matra Datavision
|
|
||||||
// Copyright (c) 1999-2012 OPEN CASCADE SAS
|
|
||||||
//
|
|
||||||
// The content of this file is subject to the Open CASCADE Technology Public
|
|
||||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
|
||||||
// except in compliance with the License. Please obtain a copy of the License
|
|
||||||
// at http://www.opencascade.org and read it completely before using this file.
|
|
||||||
//
|
|
||||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
||||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
||||||
//
|
|
||||||
// The Original Code and all software distributed under the License is
|
|
||||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
||||||
// Initial Developer hereby disclaims all such warranties, including without
|
|
||||||
// limitation, any warranties of merchantability, fitness for a particular
|
|
||||||
// purpose or non-infringement. Please see the License for the specific terms
|
|
||||||
// and conditions governing the rights and limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
// Modified: 03-02-98 : FMN ; Add Flag Normal
|
|
||||||
|
|
||||||
|
|
||||||
//-Version
|
|
||||||
|
|
||||||
//-Design Declaration des variables specifiques aux points
|
|
||||||
|
|
||||||
//-Warning Un point est defini par ses coordonnees et sa normale et des coordonnees texture
|
|
||||||
|
|
||||||
//-References
|
|
||||||
|
|
||||||
//-Language C++ 2.0
|
|
||||||
|
|
||||||
//-Declarations
|
|
||||||
|
|
||||||
// for the class
|
|
||||||
#include <Graphic3d_VertexNT.ixx>
|
|
||||||
|
|
||||||
//-Aliases
|
|
||||||
|
|
||||||
//-Global data definitions
|
|
||||||
|
|
||||||
// -- la normale au point
|
|
||||||
// MyTX, MyTY : Standard_Real;
|
|
||||||
|
|
||||||
//-Constructors
|
|
||||||
|
|
||||||
//-Destructors
|
|
||||||
|
|
||||||
//-Methods, in order
|
|
||||||
|
|
||||||
Graphic3d_VertexNT::Graphic3d_VertexNT ():
|
|
||||||
Graphic3d_VertexN (0.0, 0.0, 0.0, 0.0, 0.0, 1.0),
|
|
||||||
MyTX(0.0),
|
|
||||||
MyTY(0.0) {
|
|
||||||
}
|
|
||||||
|
|
||||||
Graphic3d_VertexNT::Graphic3d_VertexNT (const Standard_Real AX, const Standard_Real AY, const Standard_Real AZ, const Standard_Real ANX, const Standard_Real ANY, const Standard_Real ANZ,const Standard_Real ATX,const Standard_Real ATY,const Standard_Boolean FlagNormalise):
|
|
||||||
Graphic3d_VertexN (0.0, 0.0, 0.0, 0.0, 0.0, 1.0,FlagNormalise),
|
|
||||||
MyTX(ATX),
|
|
||||||
MyTY(ATY) {
|
|
||||||
}
|
|
||||||
|
|
||||||
Graphic3d_VertexNT::Graphic3d_VertexNT (const Graphic3d_Vertex& APoint, const Graphic3d_Vector& AVector,const Standard_Real ATX,const Standard_Real ATY,const Standard_Boolean FlagNormalise):
|
|
||||||
Graphic3d_VertexN (APoint, AVector,FlagNormalise),
|
|
||||||
MyTX(ATX),
|
|
||||||
MyTY(ATY) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_VertexNT::SetTextureCoordinate(const Standard_Real ATX,const Standard_Real ATY)
|
|
||||||
{
|
|
||||||
MyTX = ATX;
|
|
||||||
MyTY = ATY;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Graphic3d_VertexNT::TextureCoordinate(Standard_Real& ATX,Standard_Real& ATY) const
|
|
||||||
{
|
|
||||||
ATX = MyTX;
|
|
||||||
ATY = MyTY;
|
|
||||||
}
|
|
@ -15,4 +15,3 @@ InterfaceGraphic_PrimitiveArray.hxx
|
|||||||
InterfaceGraphic_telem.hxx
|
InterfaceGraphic_telem.hxx
|
||||||
InterfaceGraphic_degeneration.hxx
|
InterfaceGraphic_degeneration.hxx
|
||||||
InterfaceGraphic_tgl_all.hxx
|
InterfaceGraphic_tgl_all.hxx
|
||||||
InterfaceGraphic_Cextern.hxx
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -44,9 +44,10 @@ struct TEL_TEXTURE_COORD
|
|||||||
|
|
||||||
typedef TEL_TEXTURE_COORD* tel_texture_coord;
|
typedef TEL_TEXTURE_COORD* tel_texture_coord;
|
||||||
|
|
||||||
struct TEL_POINT
|
class TEL_POINT
|
||||||
{
|
{
|
||||||
float xyz[3];
|
public:
|
||||||
|
float xyz[3];
|
||||||
DEFINE_STANDARD_ALLOC
|
DEFINE_STANDARD_ALLOC
|
||||||
};
|
};
|
||||||
typedef TEL_POINT* tel_point;
|
typedef TEL_POINT* tel_point;
|
||||||
|
@ -18,18 +18,13 @@
|
|||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
#define _POLYGONES_
|
|
||||||
// if define _POLYGONES_ ColorPrsBuilder use ArrayOfPolygons for drawing faces
|
|
||||||
|
|
||||||
#include <MeshVS_ElementalColorPrsBuilder.ixx>
|
#include <MeshVS_ElementalColorPrsBuilder.ixx>
|
||||||
|
|
||||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
#include <Graphic3d_ArrayOfPolygons.hxx>
|
#include <Graphic3d_ArrayOfPolygons.hxx>
|
||||||
#include <Graphic3d_ArrayOfPolylines.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Graphic3d_Vertex.hxx>
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
|
||||||
|
|
||||||
#include <Prs3d_ShadingAspect.hxx>
|
#include <Prs3d_ShadingAspect.hxx>
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
@ -375,18 +370,14 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
|||||||
if ( IsPolyG )
|
if ( IsPolyG )
|
||||||
{
|
{
|
||||||
aGGroup->SetPrimitivesAspect ( anAsp );
|
aGGroup->SetPrimitivesAspect ( anAsp );
|
||||||
aGGroup->BeginPrimitives();
|
|
||||||
aGGroup->AddPrimitiveArray ( aPolyGArr );
|
aGGroup->AddPrimitiveArray ( aPolyGArr );
|
||||||
aGGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
if ( IsPolyL )
|
if ( IsPolyL )
|
||||||
{
|
{
|
||||||
anAsp->SetEdgeOff();
|
anAsp->SetEdgeOff();
|
||||||
aLGroup->SetPrimitivesAspect ( anAsp );
|
aLGroup->SetPrimitivesAspect ( anAsp );
|
||||||
aLGroup->SetPrimitivesAspect ( anLAsp );
|
aLGroup->SetPrimitivesAspect ( anLAsp );
|
||||||
aLGroup->BeginPrimitives();
|
|
||||||
aLGroup->AddPrimitiveArray ( aPolyLArr );
|
aLGroup->AddPrimitiveArray ( aPolyLArr );
|
||||||
aLGroup->EndPrimitives();
|
|
||||||
if (anEdgeOn)
|
if (anEdgeOn)
|
||||||
anAsp->SetEdgeOn();
|
anAsp->SetEdgeOn();
|
||||||
else
|
else
|
||||||
@ -446,10 +437,8 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
|||||||
if ( aSize<=0 )
|
if ( aSize<=0 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
#ifdef _POLYGONES_
|
|
||||||
Handle (Graphic3d_ArrayOfPolygons) aPolyArr = new Graphic3d_ArrayOfPolygons
|
Handle (Graphic3d_ArrayOfPolygons) aPolyArr = new Graphic3d_ArrayOfPolygons
|
||||||
( aMaxFaceNodes*aSize, aSize, 0, IsReflect );
|
( aMaxFaceNodes*aSize, aSize, 0, IsReflect );
|
||||||
#endif
|
|
||||||
|
|
||||||
MeshVS_TwoColors aTC = aColIter2.Key();
|
MeshVS_TwoColors aTC = aColIter2.Key();
|
||||||
Quantity_Color aMyIntColor, aMyBackColor;
|
Quantity_Color aMyIntColor, aMyBackColor;
|
||||||
@ -469,7 +458,6 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
|||||||
anAsp->SetEdgeOff();
|
anAsp->SetEdgeOff();
|
||||||
|
|
||||||
aGroup2->SetPrimitivesAspect ( anAsp );
|
aGroup2->SetPrimitivesAspect ( anAsp );
|
||||||
aGroup2->BeginPrimitives();
|
|
||||||
|
|
||||||
for( it.Reset(); it.More(); it.Next() )
|
for( it.Reset(); it.More(); it.Next() )
|
||||||
{
|
{
|
||||||
@ -491,15 +479,10 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
|||||||
Standard_Boolean hasNormals = /*IsReflect &&*/
|
Standard_Boolean hasNormals = /*IsReflect &&*/
|
||||||
aSource->GetNormalsByElement( aKey, IsMeshSmoothShading, aMaxFaceNodes, aNormals );
|
aSource->GetNormalsByElement( aKey, IsMeshSmoothShading, aMaxFaceNodes, aNormals );
|
||||||
|
|
||||||
#ifdef _POLYGONES_
|
|
||||||
aPolyArr->AddBound ( NbNodes );
|
aPolyArr->AddBound ( NbNodes );
|
||||||
#else
|
|
||||||
Graphic3d_Array1OfVertex aVertArr ( 1, NbNodes );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for ( i=1; i<=NbNodes; i++ )
|
for ( i=1; i<=NbNodes; i++ )
|
||||||
{
|
{
|
||||||
#ifdef _POLYGONES_
|
|
||||||
if ( IsReflect )
|
if ( IsReflect )
|
||||||
{
|
{
|
||||||
hasNormals ? aPolyArr->AddVertex ( aCoords(3 * i - 2),
|
hasNormals ? aPolyArr->AddVertex ( aCoords(3 * i - 2),
|
||||||
@ -519,43 +502,11 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
|
|||||||
aPolyArr->AddVertex ( aCoords(3*i-2),
|
aPolyArr->AddVertex ( aCoords(3*i-2),
|
||||||
aCoords(3*i-1),
|
aCoords(3*i-1),
|
||||||
aCoords(3*i ) );
|
aCoords(3*i ) );
|
||||||
#else
|
|
||||||
if ( IsReflect )
|
|
||||||
{
|
|
||||||
aVertArr (i) = hasNormals ? Graphic3d_VertexN( aCoords(3 * i - 2),
|
|
||||||
aCoords(3 * i - 1),
|
|
||||||
aCoords(3 * i ),
|
|
||||||
aNormals->Value(3 * i - 2),
|
|
||||||
aNormals->Value(3 * i - 1),
|
|
||||||
aNormals->Value(3 * i ),
|
|
||||||
Standard_False ) :
|
|
||||||
Graphic3d_VertexN( aCoords(3 * i - 2),
|
|
||||||
aCoords(3 * i - 1),
|
|
||||||
aCoords(3 * i ),
|
|
||||||
0.,
|
|
||||||
0.,
|
|
||||||
1.,
|
|
||||||
Standard_False );
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
Graphic3d_Vertex ( aCoords(3 * i - 2),
|
|
||||||
aCoords(3 * i - 1),
|
|
||||||
aCoords(3 * i ) );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef _POLYGONES_
|
|
||||||
aGroup2->Polygon ( aVertArr );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef _POLYGONES_
|
|
||||||
aGroup2->AddPrimitiveArray ( aPolyArr );
|
aGroup2->AddPrimitiveArray ( aPolyArr );
|
||||||
#endif
|
|
||||||
aGroup2->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,8 +24,6 @@
|
|||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <TColStd_ListIteratorOfListOfReal.hxx>
|
#include <TColStd_ListIteratorOfListOfReal.hxx>
|
||||||
#include <Prs3d_Root.hxx>
|
#include <Prs3d_Root.hxx>
|
||||||
#include <Graphic3d_Vertex.hxx>
|
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
|
||||||
#include <SelectMgr_SelectableObject.hxx>
|
#include <SelectMgr_SelectableObject.hxx>
|
||||||
#include <PrsMgr_PresentationManager.hxx>
|
#include <PrsMgr_PresentationManager.hxx>
|
||||||
#include <PrsMgr_PresentationManager3d.hxx>
|
#include <PrsMgr_PresentationManager3d.hxx>
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <Graphic3d_AspectFillArea3d.hxx>
|
#include <Graphic3d_AspectFillArea3d.hxx>
|
||||||
#include <Graphic3d_AspectMarker3d.hxx>
|
#include <Graphic3d_AspectMarker3d.hxx>
|
||||||
#include <Graphic3d_ArrayOfPolygons.hxx>
|
#include <Graphic3d_ArrayOfPolygons.hxx>
|
||||||
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
#include <Graphic3d_ArrayOfPolylines.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_Array1OfVertex.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
@ -155,10 +156,7 @@ void MeshVS_MeshPrsBuilder::BuildNodes ( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
Prs3d_Root::NewGroup ( Prs );
|
Prs3d_Root::NewGroup ( Prs );
|
||||||
Handle (Graphic3d_Group) aNodeGroup = Prs3d_Root::CurrentGroup ( Prs );
|
Handle (Graphic3d_Group) aNodeGroup = Prs3d_Root::CurrentGroup ( Prs );
|
||||||
aNodeGroup->SetPrimitivesAspect ( aNodeMark );
|
aNodeGroup->SetPrimitivesAspect ( aNodeMark );
|
||||||
|
|
||||||
aNodeGroup->BeginPrimitives();
|
|
||||||
aNodeGroup->MarkerSet ( aNodePoints );
|
aNodeGroup->MarkerSet ( aNodePoints );
|
||||||
aNodeGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,14 +345,6 @@ void MeshVS_MeshPrsBuilder::BuildElements( const Handle(Prs3d_Presentation)& Prs
|
|||||||
// add shading presentation
|
// add shading presentation
|
||||||
if ( ( IsShading || IsShrink ) && !HasSelectFlag )
|
if ( ( IsShading || IsShrink ) && !HasSelectFlag )
|
||||||
AddVolumePrs ( aTopo, aCoords, NbNodes, aVolumes, IsReflect, IsShrink, HasSelectFlag, aShrinkCoef );
|
AddVolumePrs ( aTopo, aCoords, NbNodes, aVolumes, IsReflect, IsShrink, HasSelectFlag, aShrinkCoef );
|
||||||
|
|
||||||
/*
|
|
||||||
Handle( Graphic3d_ArrayOfPrimitives ) anArr = aVolumes;
|
|
||||||
if( IsWireFrame || HasSelectFlag )
|
|
||||||
anArr = aPolylines;
|
|
||||||
|
|
||||||
AddVolumePrs ( aTopo, aCoords, NbNodes, anArr, IsReflect, IsShrink, HasSelectFlag, aShrinkCoef );
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -492,26 +482,21 @@ void MeshVS_MeshPrsBuilder::BuildHilightPrs ( const Handle(Prs3d_Presentation)&
|
|||||||
case MeshVS_ET_Link:
|
case MeshVS_ET_Link:
|
||||||
{
|
{
|
||||||
aHilightGroup->SetPrimitivesAspect ( aBeam );
|
aHilightGroup->SetPrimitivesAspect ( aBeam );
|
||||||
aHilightGroup->Polyline ( Graphic3d_Vertex ( aCoords(1), aCoords(2), aCoords(3) ),
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
Graphic3d_Vertex ( aCoords(4), aCoords(5), aCoords(6) ) );
|
aPrims->AddVertex(aCoords(1),aCoords(2),aCoords(3));
|
||||||
|
aPrims->AddVertex(aCoords(4),aCoords(5),aCoords(6));
|
||||||
|
aHilightGroup->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MeshVS_ET_Face:
|
case MeshVS_ET_Face:
|
||||||
if ( NbNodes > 0 )
|
if ( NbNodes > 0 )
|
||||||
{
|
{
|
||||||
Standard_Real X, Y, Z;
|
|
||||||
aHilightGroup->SetPrimitivesAspect ( aFill );
|
aHilightGroup->SetPrimitivesAspect ( aFill );
|
||||||
Graphic3d_Array1OfVertex aVArr ( 1, NbNodes );
|
Handle(Graphic3d_ArrayOfPolygons) aPrims = new Graphic3d_ArrayOfPolygons(NbNodes);
|
||||||
|
|
||||||
for ( Standard_Integer k=1; k<=NbNodes; k++)
|
for ( Standard_Integer k=1; k<=NbNodes; k++)
|
||||||
{
|
aPrims->AddVertex(aCoords(3*k-2),aCoords(3*k-1),aCoords(3*k));
|
||||||
X = aCoords(3*k-2);
|
aHilightGroup->AddPrimitiveArray(aPrims);
|
||||||
Y = aCoords(3*k-1);
|
|
||||||
Z = aCoords(3*k);
|
|
||||||
aVArr.SetValue ( k, Graphic3d_Vertex ( X, Y, Z ) );
|
|
||||||
}
|
|
||||||
aHilightGroup->Polygon ( aVArr );
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -524,21 +509,25 @@ void MeshVS_MeshPrsBuilder::BuildHilightPrs ( const Handle(Prs3d_Presentation)&
|
|||||||
|
|
||||||
if( aSource->Get3DGeom( ID, NbNodes, aTopo ) )
|
if( aSource->Get3DGeom( ID, NbNodes, aTopo ) )
|
||||||
{
|
{
|
||||||
Standard_Integer low = aTopo->Lower(), up = aTopo->Upper(), i, j, m, ind;
|
const Standard_Integer up = aTopo->Upper();
|
||||||
for( i=low; i<=up; i++ )
|
const Standard_Integer lo = aTopo->Lower();
|
||||||
|
Standard_Integer nbnodes = 0, i, j;
|
||||||
|
for( i=lo; i<=up; i++ )
|
||||||
|
nbnodes += aTopo->Value( i ).Length();
|
||||||
|
|
||||||
|
Handle(Graphic3d_ArrayOfPolygons) aPrims = new Graphic3d_ArrayOfPolygons(nbnodes,aTopo->Length());
|
||||||
|
for( i=lo; i<=up; i++ )
|
||||||
{
|
{
|
||||||
const TColStd_SequenceOfInteger& aSeq = aTopo->Value( i );
|
const TColStd_SequenceOfInteger& aSeq = aTopo->Value( i );
|
||||||
m = aSeq.Length();
|
const Standard_Integer m = aSeq.Length();
|
||||||
Graphic3d_Array1OfVertex aVArr( 1, m );
|
aPrims->AddBound(m);
|
||||||
for( j=1; j<=m; j++ )
|
for( j=1; j<=m; j++ )
|
||||||
{
|
{
|
||||||
ind = aSeq.Value( j );
|
const Standard_Integer ind = 3*aSeq.Value( j );
|
||||||
aVArr.SetValue( j, Graphic3d_Vertex( aCoords( 3*ind+1 ),
|
aPrims->AddVertex(aCoords(ind+1),aCoords(ind+2),aCoords(ind+3));
|
||||||
aCoords( 3*ind+2 ),
|
|
||||||
aCoords( 3*ind+3 ) ) );
|
|
||||||
}
|
}
|
||||||
aHilightGroup->Polygon ( aVArr );
|
|
||||||
}
|
}
|
||||||
|
aHilightGroup->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -933,9 +922,7 @@ void MeshVS_MeshPrsBuilder::DrawArrays( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
if( IsFacePolygons )
|
if( IsFacePolygons )
|
||||||
{
|
{
|
||||||
aGroup->SetPrimitivesAspect ( theFillAsp );
|
aGroup->SetPrimitivesAspect ( theFillAsp );
|
||||||
aGroup->BeginPrimitives ();
|
|
||||||
aGroup->AddPrimitiveArray ( thePolygons );
|
aGroup->AddPrimitiveArray ( thePolygons );
|
||||||
aGroup->EndPrimitives ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( IsVolumePolygons )
|
if( IsVolumePolygons )
|
||||||
@ -952,9 +939,7 @@ void MeshVS_MeshPrsBuilder::DrawArrays( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
aCullFillAsp->SuppressBackFace();
|
aCullFillAsp->SuppressBackFace();
|
||||||
|
|
||||||
aGroup->SetPrimitivesAspect ( aCullFillAsp );
|
aGroup->SetPrimitivesAspect ( aCullFillAsp );
|
||||||
aGroup->BeginPrimitives ();
|
|
||||||
aGroup->AddPrimitiveArray ( theVolumesInShad );
|
aGroup->AddPrimitiveArray ( theVolumesInShad );
|
||||||
aGroup->EndPrimitives ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -972,9 +957,7 @@ void MeshVS_MeshPrsBuilder::DrawArrays( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
aLGroup->SetPrimitivesAspect ( new Graphic3d_AspectLine3d
|
aLGroup->SetPrimitivesAspect ( new Graphic3d_AspectLine3d
|
||||||
( anEdgeColor, Aspect_TOL_SOLID, aWidth ) );
|
( anEdgeColor, Aspect_TOL_SOLID, aWidth ) );
|
||||||
}
|
}
|
||||||
aLGroup->BeginPrimitives ();
|
|
||||||
aLGroup->AddPrimitiveArray ( theLines );
|
aLGroup->AddPrimitiveArray ( theLines );
|
||||||
aLGroup->EndPrimitives ();
|
|
||||||
theFillAsp->SetEdgeOn();
|
theFillAsp->SetEdgeOn();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -987,10 +970,7 @@ void MeshVS_MeshPrsBuilder::DrawArrays( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
if ( !IsSelected )
|
if ( !IsSelected )
|
||||||
aBeamGroup->SetPrimitivesAspect ( theFillAsp );
|
aBeamGroup->SetPrimitivesAspect ( theFillAsp );
|
||||||
aBeamGroup->SetPrimitivesAspect ( theLineAsp );
|
aBeamGroup->SetPrimitivesAspect ( theLineAsp );
|
||||||
|
|
||||||
aBeamGroup->BeginPrimitives();
|
|
||||||
aBeamGroup->AddPrimitiveArray ( theLinkLines );
|
aBeamGroup->AddPrimitiveArray ( theLinkLines );
|
||||||
aBeamGroup->EndPrimitives();
|
|
||||||
theFillAsp->SetEdgeOn();
|
theFillAsp->SetEdgeOn();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1012,9 +992,7 @@ void MeshVS_MeshPrsBuilder::DrawArrays( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
if( IsFacePolygons )
|
if( IsFacePolygons )
|
||||||
{
|
{
|
||||||
aGroup->SetPrimitivesAspect ( theFillAsp );
|
aGroup->SetPrimitivesAspect ( theFillAsp );
|
||||||
aGroup->BeginPrimitives ();
|
|
||||||
aGroup->AddPrimitiveArray ( thePolygons );
|
aGroup->AddPrimitiveArray ( thePolygons );
|
||||||
aGroup->EndPrimitives ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( IsVolumePolygons )
|
if( IsVolumePolygons )
|
||||||
@ -1031,9 +1009,7 @@ void MeshVS_MeshPrsBuilder::DrawArrays( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
aCullFillAsp->SuppressBackFace();
|
aCullFillAsp->SuppressBackFace();
|
||||||
|
|
||||||
aGroup->SetPrimitivesAspect ( aCullFillAsp );
|
aGroup->SetPrimitivesAspect ( aCullFillAsp );
|
||||||
aGroup->BeginPrimitives ();
|
|
||||||
aGroup->AddPrimitiveArray ( theVolumesInShad );
|
aGroup->AddPrimitiveArray ( theVolumesInShad );
|
||||||
aGroup->EndPrimitives ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,7 @@
|
|||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
#include <Graphic3d_ArrayOfPolygons.hxx>
|
#include <Graphic3d_ArrayOfPolygons.hxx>
|
||||||
#include <Graphic3d_ArrayOfPolylines.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Graphic3d_Vertex.hxx>
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
|
||||||
#include <Graphic3d_TextureParams.hxx>
|
#include <Graphic3d_TextureParams.hxx>
|
||||||
|
|
||||||
#include <Prs3d_ShadingAspect.hxx>
|
#include <Prs3d_ShadingAspect.hxx>
|
||||||
@ -59,7 +57,6 @@
|
|||||||
#include <Graphic3d_TypeOfTextureMode.hxx>
|
#include <Graphic3d_TypeOfTextureMode.hxx>
|
||||||
#include <Standard_DefineHandle.hxx>
|
#include <Standard_DefineHandle.hxx>
|
||||||
#include <PrsMgr_PresentationManager3d.hxx>
|
#include <PrsMgr_PresentationManager3d.hxx>
|
||||||
#include <Graphic3d_Array1OfVertexNT.hxx>
|
|
||||||
#include <AIS_Drawer.hxx>
|
#include <AIS_Drawer.hxx>
|
||||||
#include <Quantity_Array1OfColor.hxx>
|
#include <Quantity_Array1OfColor.hxx>
|
||||||
#include <Aspect_SequenceOfColor.hxx>
|
#include <Aspect_SequenceOfColor.hxx>
|
||||||
@ -531,9 +528,7 @@ void MeshVS_NodalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
Handle(Graphic3d_Group) aGroup1 = Prs3d_Root::CurrentGroup ( Prs );
|
Handle(Graphic3d_Group) aGroup1 = Prs3d_Root::CurrentGroup ( Prs );
|
||||||
|
|
||||||
aGroup1->SetPrimitivesAspect( anAsp );
|
aGroup1->SetPrimitivesAspect( anAsp );
|
||||||
aGroup1->BeginPrimitives();
|
|
||||||
aGroup1->AddPrimitiveArray( aCPolyArr );
|
aGroup1->AddPrimitiveArray( aCPolyArr );
|
||||||
aGroup1->EndPrimitives();
|
|
||||||
|
|
||||||
if (aShowEdges)
|
if (aShowEdges)
|
||||||
{
|
{
|
||||||
@ -544,9 +539,7 @@ void MeshVS_NodalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
anAsp->SetTextureMapOff();
|
anAsp->SetTextureMapOff();
|
||||||
aGroup2->SetPrimitivesAspect( anAsp );
|
aGroup2->SetPrimitivesAspect( anAsp );
|
||||||
aGroup2->SetPrimitivesAspect( anLAsp );
|
aGroup2->SetPrimitivesAspect( anLAsp );
|
||||||
aGroup2->BeginPrimitives();
|
|
||||||
aGroup2->AddPrimitiveArray( aPolyL );
|
aGroup2->AddPrimitiveArray( aPolyL );
|
||||||
aGroup2->EndPrimitives();
|
|
||||||
anAsp->SetEdgeOn();
|
anAsp->SetEdgeOn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -203,8 +203,6 @@ void MeshVS_TextPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
aTextGroup->SetPrimitivesAspect( aTextAspect );
|
aTextGroup->SetPrimitivesAspect( aTextAspect );
|
||||||
aTextGroup->SetPrimitivesAspect( anAspectMarker3d );
|
aTextGroup->SetPrimitivesAspect( anAspectMarker3d );
|
||||||
|
|
||||||
aTextGroup->BeginPrimitives();
|
|
||||||
|
|
||||||
MeshVS_Buffer aCoordsBuf (3*aMaxFaceNodes*sizeof(Standard_Real));
|
MeshVS_Buffer aCoordsBuf (3*aMaxFaceNodes*sizeof(Standard_Real));
|
||||||
TColStd_Array1OfReal aCoords (aCoordsBuf, 1, 3*aMaxFaceNodes);
|
TColStd_Array1OfReal aCoords (aCoordsBuf, 1, 3*aMaxFaceNodes);
|
||||||
Standard_Integer NbNodes;
|
Standard_Integer NbNodes;
|
||||||
@ -270,8 +268,6 @@ void MeshVS_TextPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
aTextGroup->EndPrimitives();
|
|
||||||
|
|
||||||
if (!aCustomElements.IsEmpty())
|
if (!aCustomElements.IsEmpty())
|
||||||
CustomBuild ( Prs, aCustomElements, IDsToExclude, theDisplayMode );
|
CustomBuild ( Prs, aCustomElements, IDsToExclude, theDisplayMode );
|
||||||
}
|
}
|
||||||
|
@ -339,10 +339,8 @@ void MeshVS_VectorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
new Graphic3d_AspectLine3d ( aColor, Aspect_TOL_SOLID, 1.5 );
|
new Graphic3d_AspectLine3d ( aColor, Aspect_TOL_SOLID, 1.5 );
|
||||||
|
|
||||||
aVGroup->SetPrimitivesAspect( aLinAspect );
|
aVGroup->SetPrimitivesAspect( aLinAspect );
|
||||||
|
|
||||||
aVGroup->BeginPrimitives();
|
|
||||||
aVGroup->AddPrimitiveArray( aLineArray );
|
aVGroup->AddPrimitiveArray( aLineArray );
|
||||||
aVGroup->EndPrimitives();
|
|
||||||
if ( !myIsSimplePrs )
|
if ( !myIsSimplePrs )
|
||||||
{
|
{
|
||||||
Graphic3d_MaterialAspect aMatAspect;
|
Graphic3d_MaterialAspect aMatAspect;
|
||||||
@ -356,10 +354,7 @@ void MeshVS_VectorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
1., aMatAspect, aMatAspect );
|
1., aMatAspect, aMatAspect );
|
||||||
|
|
||||||
aVGroup->SetPrimitivesAspect( aFillAspect );
|
aVGroup->SetPrimitivesAspect( aFillAspect );
|
||||||
|
|
||||||
aVGroup->BeginPrimitives();
|
|
||||||
aVGroup->AddPrimitiveArray( aTriangleArray );
|
aVGroup->AddPrimitiveArray( aTriangleArray );
|
||||||
aVGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -367,10 +362,7 @@ void MeshVS_VectorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
|
|||||||
new Graphic3d_AspectLine3d ( aColor, Aspect_TOL_SOLID, mySimpleWidthPrm * 1.5 );
|
new Graphic3d_AspectLine3d ( aColor, Aspect_TOL_SOLID, mySimpleWidthPrm * 1.5 );
|
||||||
|
|
||||||
aVGroup->SetPrimitivesAspect( anArrowLinAspect );
|
aVGroup->SetPrimitivesAspect( anArrowLinAspect );
|
||||||
|
|
||||||
aVGroup->BeginPrimitives();
|
|
||||||
aVGroup->AddPrimitiveArray( aArrowLineArray );
|
aVGroup->AddPrimitiveArray( aArrowLineArray );
|
||||||
aVGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !aCustomElements.IsEmpty() )
|
if( !aCustomElements.IsEmpty() )
|
||||||
|
@ -47,7 +47,6 @@
|
|||||||
#include <Graphic3d_CGroup.hxx>
|
#include <Graphic3d_CGroup.hxx>
|
||||||
#include <Graphic3d_TypeOfPrimitive.hxx>
|
#include <Graphic3d_TypeOfPrimitive.hxx>
|
||||||
#include <Graphic3d_CPick.hxx>
|
#include <Graphic3d_CPick.hxx>
|
||||||
#include <Graphic3d_TypeOfPolygon.hxx>
|
|
||||||
#include <Graphic3d_TextPath.hxx>
|
#include <Graphic3d_TextPath.hxx>
|
||||||
#include <Graphic3d_HorizontalTextAlignment.hxx>
|
#include <Graphic3d_HorizontalTextAlignment.hxx>
|
||||||
#include <Graphic3d_VerticalTextAlignment.hxx>
|
#include <Graphic3d_VerticalTextAlignment.hxx>
|
||||||
@ -59,13 +58,7 @@
|
|||||||
#include <Graphic3d_SortType.hxx>
|
#include <Graphic3d_SortType.hxx>
|
||||||
#include <Graphic3d_PtrFrameBuffer.hxx>
|
#include <Graphic3d_PtrFrameBuffer.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_Array1OfVertex.hxx>
|
||||||
#include <Graphic3d_Array1OfVertexN.hxx>
|
|
||||||
#include <Graphic3d_Array1OfVertexNT.hxx>
|
|
||||||
#include <Graphic3d_Array1OfVertexC.hxx>
|
|
||||||
#include <Graphic3d_Array1OfVertexNC.hxx>
|
|
||||||
#include <Graphic3d_Array2OfVertex.hxx>
|
#include <Graphic3d_Array2OfVertex.hxx>
|
||||||
#include <Graphic3d_Array2OfVertexN.hxx>
|
|
||||||
#include <Graphic3d_Array2OfVertexNT.hxx>
|
|
||||||
#include <Graphic3d_BufferType.hxx>
|
#include <Graphic3d_BufferType.hxx>
|
||||||
#include <NCollection_DataMap.hxx>
|
#include <NCollection_DataMap.hxx>
|
||||||
|
|
||||||
@ -73,7 +66,6 @@ class TColStd_Array1OfInteger;
|
|||||||
class TColStd_Array1OfReal;
|
class TColStd_Array1OfReal;
|
||||||
class TColStd_Array2OfReal;
|
class TColStd_Array2OfReal;
|
||||||
class TColStd_HArray1OfByte;
|
class TColStd_HArray1OfByte;
|
||||||
class Graphic3d_VertexNC;
|
|
||||||
class Graphic3d_Vector;
|
class Graphic3d_Vector;
|
||||||
class Quantity_Color;
|
class Quantity_Color;
|
||||||
class Graphic3d_Vertex;
|
class Graphic3d_Vertex;
|
||||||
@ -108,7 +100,6 @@ public:
|
|||||||
public: // Methods for graphical groups
|
public: // Methods for graphical groups
|
||||||
|
|
||||||
Standard_EXPORT void ClearGroup (const Graphic3d_CGroup& ACGroup);
|
Standard_EXPORT void ClearGroup (const Graphic3d_CGroup& ACGroup);
|
||||||
Standard_EXPORT void CloseGroup (const Graphic3d_CGroup& ACGroup);
|
|
||||||
Standard_EXPORT void FaceContextGroup (const Graphic3d_CGroup& theCGroup,
|
Standard_EXPORT void FaceContextGroup (const Graphic3d_CGroup& theCGroup,
|
||||||
const Standard_Integer theNoInsert);
|
const Standard_Integer theNoInsert);
|
||||||
Standard_EXPORT void Group (Graphic3d_CGroup& theCGroup);
|
Standard_EXPORT void Group (Graphic3d_CGroup& theCGroup);
|
||||||
@ -121,7 +112,6 @@ public: // Methods for graphical groups
|
|||||||
const Standard_Integer theMarkWidth,
|
const Standard_Integer theMarkWidth,
|
||||||
const Standard_Integer theMarkHeight,
|
const Standard_Integer theMarkHeight,
|
||||||
const Handle(TColStd_HArray1OfByte)& theTexture);
|
const Handle(TColStd_HArray1OfByte)& theTexture);
|
||||||
Standard_EXPORT void OpenGroup (const Graphic3d_CGroup& theCGroup);
|
|
||||||
Standard_EXPORT void RemoveGroup (const Graphic3d_CGroup& theCGroup);
|
Standard_EXPORT void RemoveGroup (const Graphic3d_CGroup& theCGroup);
|
||||||
Standard_EXPORT void TextContextGroup (const Graphic3d_CGroup& theCGroup,
|
Standard_EXPORT void TextContextGroup (const Graphic3d_CGroup& theCGroup,
|
||||||
const Standard_Integer theNoInsert);
|
const Standard_Integer theNoInsert);
|
||||||
@ -171,9 +161,8 @@ public:
|
|||||||
Standard_EXPORT void ViewMapping (const Graphic3d_CView& ACView, const Standard_Boolean AWait);
|
Standard_EXPORT void ViewMapping (const Graphic3d_CView& ACView, const Standard_Boolean AWait);
|
||||||
Standard_EXPORT void ViewOrientation (const Graphic3d_CView& ACView,const Standard_Boolean AWait);
|
Standard_EXPORT void ViewOrientation (const Graphic3d_CView& ACView,const Standard_Boolean AWait);
|
||||||
Standard_EXPORT void Environment (const Graphic3d_CView& ACView);
|
Standard_EXPORT void Environment (const Graphic3d_CView& ACView);
|
||||||
Standard_EXPORT void Marker (const Graphic3d_CGroup& ACGroup, const Graphic3d_Vertex& APoint, const Standard_Boolean EvalMinMax = Standard_True);
|
Standard_EXPORT void Marker (const Graphic3d_CGroup& ACGroup, const Graphic3d_Vertex& APoint);
|
||||||
Standard_EXPORT void MarkerSet (const Graphic3d_CGroup& ACGroup, const Graphic3d_Array1OfVertex& ListVertex, const Standard_Boolean EvalMinMax = Standard_True);
|
Standard_EXPORT void MarkerSet (const Graphic3d_CGroup& ACGroup, const Graphic3d_Array1OfVertex& ListVertex);
|
||||||
Standard_EXPORT void Polygon (const Graphic3d_CGroup& ACGroup, const Graphic3d_Array1OfVertex& ListVertex, const Graphic3d_TypeOfPolygon AType = Graphic3d_TOP_CONVEX, const Standard_Boolean EvalMinMax = Standard_True);
|
|
||||||
Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True);
|
Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True);
|
||||||
Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax = Standard_True);
|
Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const Standard_CString AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Standard_Boolean EvalMinMax = Standard_True);
|
||||||
Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const TCollection_ExtendedString& AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True);
|
Standard_EXPORT void Text (const Graphic3d_CGroup& ACGroup, const TCollection_ExtendedString& AText, const Graphic3d_Vertex& APoint, const Standard_Real AHeight, const Quantity_PlaneAngle AAngle, const Graphic3d_TextPath ATp, const Graphic3d_HorizontalTextAlignment AHta, const Graphic3d_VerticalTextAlignment AVta, const Standard_Boolean EvalMinMax = Standard_True);
|
||||||
@ -267,7 +256,6 @@ public:
|
|||||||
//! Clear visualization data in graphical driver and stop <br>
|
//! Clear visualization data in graphical driver and stop <br>
|
||||||
//! displaying the primitives array of the graphical group <theCGroup>. <br>
|
//! displaying the primitives array of the graphical group <theCGroup>. <br>
|
||||||
//! This method is internal and should be used by Graphic3d_Group only. <br>
|
//! This method is internal and should be used by Graphic3d_Group only. <br>
|
||||||
Standard_EXPORT void RemovePrimitiveArray(const Graphic3d_CGroup& theCGroup,const Graphic3d_PrimitiveArray& thePArray);
|
|
||||||
Standard_EXPORT Standard_Integer InquirePlaneLimit();
|
Standard_EXPORT Standard_Integer InquirePlaneLimit();
|
||||||
Standard_EXPORT Standard_ShortReal DefaultTextHeight() const;
|
Standard_EXPORT Standard_ShortReal DefaultTextHeight() const;
|
||||||
Standard_EXPORT void FBOGetDimensions(const Graphic3d_CView& view,const Graphic3d_PtrFrameBuffer fboPtr,Standard_Integer& width,Standard_Integer& height,Standard_Integer& widthMax,Standard_Integer& heightMax);
|
Standard_EXPORT void FBOGetDimensions(const Graphic3d_CView& view,const Graphic3d_PtrFrameBuffer fboPtr,Standard_Integer& width,Standard_Integer& height,Standard_Integer& widthMax,Standard_Integer& heightMax);
|
||||||
|
@ -34,11 +34,6 @@ void OpenGl_GraphicDriver::ClearGroup (const Graphic3d_CGroup& theCGroup)
|
|||||||
InvalidateAllWorkspaces();
|
InvalidateAllWorkspaces();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGl_GraphicDriver::CloseGroup (const Graphic3d_CGroup& )
|
|
||||||
{
|
|
||||||
// Do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenGl_GraphicDriver::FaceContextGroup (const Graphic3d_CGroup& theCGroup,
|
void OpenGl_GraphicDriver::FaceContextGroup (const Graphic3d_CGroup& theCGroup,
|
||||||
const Standard_Integer theNoInsert)
|
const Standard_Integer theNoInsert)
|
||||||
{
|
{
|
||||||
@ -96,11 +91,6 @@ void OpenGl_GraphicDriver::MarkerContextGroup (const Graphic3d_CGroup& theCGroup
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGl_GraphicDriver::OpenGroup (const Graphic3d_CGroup& )
|
|
||||||
{
|
|
||||||
// Do nothing
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenGl_GraphicDriver::RemoveGroup (const Graphic3d_CGroup& theCGroup)
|
void OpenGl_GraphicDriver::RemoveGroup (const Graphic3d_CGroup& theCGroup)
|
||||||
{
|
{
|
||||||
OpenGl_Structure* aStructure = (OpenGl_Structure* )theCGroup.Struct->ptrStructure;
|
OpenGl_Structure* aStructure = (OpenGl_Structure* )theCGroup.Struct->ptrStructure;
|
||||||
|
@ -31,7 +31,7 @@ static void OpenGl_CreateMarkers(const Graphic3d_CGroup& ACGroup, const Standard
|
|||||||
((OpenGl_Group *)ACGroup.ptrGroup)->AddElement( TelMarkerSet, amarkerset );
|
((OpenGl_Group *)ACGroup.ptrGroup)->AddElement( TelMarkerSet, amarkerset );
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenGl_GraphicDriver::Marker (const Graphic3d_CGroup& ACGroup, const Graphic3d_Vertex& APoint, const Standard_Boolean )
|
void OpenGl_GraphicDriver::Marker (const Graphic3d_CGroup& ACGroup, const Graphic3d_Vertex &APoint)
|
||||||
{
|
{
|
||||||
if (!ACGroup.ptrGroup)
|
if (!ACGroup.ptrGroup)
|
||||||
return;
|
return;
|
||||||
@ -91,8 +91,7 @@ void OpenGl_GraphicDriver::Marker (const Graphic3d_CGroup& ACGroup, const Graphi
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OpenGl_GraphicDriver::MarkerSet (const Graphic3d_CGroup& ACGroup,
|
void OpenGl_GraphicDriver::MarkerSet (const Graphic3d_CGroup& ACGroup,
|
||||||
const Graphic3d_Array1OfVertex& ListVertex,
|
const Graphic3d_Array1OfVertex& ListVertex)
|
||||||
const Standard_Boolean )
|
|
||||||
{
|
{
|
||||||
if (!ACGroup.ptrGroup)
|
if (!ACGroup.ptrGroup)
|
||||||
return;
|
return;
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
// Created on: 2011-10-20
|
|
||||||
// Created by: Sergey ZERCHANINOV
|
|
||||||
// Copyright (c) 2011-2012 OPEN CASCADE SAS
|
|
||||||
//
|
|
||||||
// The content of this file is subject to the Open CASCADE Technology Public
|
|
||||||
// License Version 6.5 (the "License"). You may not use the content of this file
|
|
||||||
// except in compliance with the License. Please obtain a copy of the License
|
|
||||||
// at http://www.opencascade.org and read it completely before using this file.
|
|
||||||
//
|
|
||||||
// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
|
|
||||||
// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
|
|
||||||
//
|
|
||||||
// The Original Code and all software distributed under the License is
|
|
||||||
// distributed on an "AS IS" basis, without warranty of any kind, and the
|
|
||||||
// Initial Developer hereby disclaims all such warranties, including without
|
|
||||||
// limitation, any warranties of merchantability, fitness for a particular
|
|
||||||
// purpose or non-infringement. Please see the License for the specific terms
|
|
||||||
// and conditions governing the rights and limitations under the License.
|
|
||||||
|
|
||||||
|
|
||||||
#include <OpenGl_GraphicDriver.hxx>
|
|
||||||
|
|
||||||
#include <OpenGl_Group.hxx>
|
|
||||||
#include <OpenGl_Polygon.hxx>
|
|
||||||
|
|
||||||
void OpenGl_GraphicDriver::Polygon (const Graphic3d_CGroup& ACGroup,
|
|
||||||
const Graphic3d_Array1OfVertex& AListVertex,
|
|
||||||
const Graphic3d_TypeOfPolygon AType,
|
|
||||||
const Standard_Boolean )
|
|
||||||
{
|
|
||||||
if (ACGroup.ptrGroup)
|
|
||||||
{
|
|
||||||
OpenGl_Polygon *apolygon = new OpenGl_Polygon( AListVertex, AType );
|
|
||||||
((OpenGl_Group *)ACGroup.ptrGroup)->AddElement( TelPolygon, apolygon );
|
|
||||||
}
|
|
||||||
}
|
|
@ -78,23 +78,6 @@ void OpenGl_GraphicDriver::PrimitiveArray( const Graphic3d_CGroup& ACGroup,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
|
||||||
//function : RemovePrimitiveArray
|
|
||||||
//purpose : Purpose: Clear visualization data in graphical driver and
|
|
||||||
// stop displaying the primitives array of the graphical group
|
|
||||||
// <theCGroup>. This method is internal and should be used by
|
|
||||||
// Graphic3d_Group only.
|
|
||||||
//=======================================================================
|
|
||||||
|
|
||||||
void OpenGl_GraphicDriver::RemovePrimitiveArray (const Graphic3d_CGroup& theCGroup,
|
|
||||||
const Graphic3d_PrimitiveArray& thePArray)
|
|
||||||
{
|
|
||||||
if (theCGroup.ptrGroup && thePArray)
|
|
||||||
{
|
|
||||||
((OpenGl_Group* )theCGroup.ptrGroup)->RemovePrimitiveArray (GetSharedContext(), thePArray);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenGl_GraphicDriver::UserDraw (const Graphic3d_CGroup& theCGroup,
|
void OpenGl_GraphicDriver::UserDraw (const Graphic3d_CGroup& theCGroup,
|
||||||
const Graphic3d_CUserDraw& theUserDraw)
|
const Graphic3d_CUserDraw& theUserDraw)
|
||||||
{
|
{
|
||||||
|
@ -132,36 +132,6 @@ void OpenGl_Group::AddElement (const TelType AType, OpenGl_Element *AElem )
|
|||||||
|
|
||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
|
|
||||||
void OpenGl_Group::RemovePrimitiveArray (const Handle(OpenGl_Context)& theGlCtx,
|
|
||||||
CALL_DEF_PARRAY* thePArray)
|
|
||||||
{
|
|
||||||
OpenGl_ElementNode *prevnode = NULL, *node = myFirst;
|
|
||||||
while (node != NULL)
|
|
||||||
{
|
|
||||||
if (node->type == TelParray)
|
|
||||||
{
|
|
||||||
CALL_DEF_PARRAY* aCurPArray = ((const OpenGl_PrimitiveArray* )node->elem)->PArray();
|
|
||||||
|
|
||||||
// validate for correct pointer
|
|
||||||
if (aCurPArray->num_bounds == thePArray->num_bounds &&
|
|
||||||
aCurPArray->num_edges == thePArray->num_edges &&
|
|
||||||
aCurPArray->num_vertexs == thePArray->num_vertexs &&
|
|
||||||
aCurPArray->type == thePArray->type)
|
|
||||||
{
|
|
||||||
(prevnode ? prevnode->next : myFirst) = node->next;
|
|
||||||
if (!myFirst) myLast = NULL;
|
|
||||||
OpenGl_Element::Destroy (theGlCtx, node->elem);
|
|
||||||
delete node;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
prevnode = node;
|
|
||||||
node = node->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*----------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
void OpenGl_Group::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
|
void OpenGl_Group::Render (const Handle(OpenGl_Workspace)& theWorkspace) const
|
||||||
{
|
{
|
||||||
// Is rendering in ADD or IMMEDIATE mode?
|
// Is rendering in ADD or IMMEDIATE mode?
|
||||||
|
@ -55,9 +55,6 @@ public:
|
|||||||
|
|
||||||
void AddElement (const TelType, OpenGl_Element * );
|
void AddElement (const TelType, OpenGl_Element * );
|
||||||
|
|
||||||
void RemovePrimitiveArray (const Handle(OpenGl_Context)& theGlCtx,
|
|
||||||
CALL_DEF_PARRAY* thePArray);
|
|
||||||
|
|
||||||
virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
|
virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const;
|
||||||
virtual void Release (const Handle(OpenGl_Context)& theGlCtx);
|
virtual void Release (const Handle(OpenGl_Context)& theGlCtx);
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@
|
|||||||
#include <OpenGl_Element.hxx>
|
#include <OpenGl_Element.hxx>
|
||||||
|
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_Array1OfVertex.hxx>
|
||||||
#include <Graphic3d_Array1OfVertexC.hxx>
|
|
||||||
|
|
||||||
class OpenGl_Polyline : public OpenGl_Element
|
class OpenGl_Polyline : public OpenGl_Element
|
||||||
{
|
{
|
||||||
|
@ -46,11 +46,9 @@ OpenGl_Text::OpenGl_Text (const TCollection_ExtendedString& AText,
|
|||||||
if (myString) delete[] myString;
|
if (myString) delete[] myString;
|
||||||
myString = wstr;
|
myString = wstr;
|
||||||
|
|
||||||
Standard_Real X, Y, Z;
|
myAttachPnt.xyz[0] = APoint.X();
|
||||||
APoint.Coord(X, Y, Z);
|
myAttachPnt.xyz[1] = APoint.Y();
|
||||||
myAttachPnt.xyz[0] = float (X);
|
myAttachPnt.xyz[2] = APoint.Z();
|
||||||
myAttachPnt.xyz[1] = float (Y);
|
|
||||||
myAttachPnt.xyz[2] = float (Z);
|
|
||||||
|
|
||||||
myParam.Height = int (AHeight);
|
myParam.Height = int (AHeight);
|
||||||
|
|
||||||
|
@ -43,9 +43,7 @@ et TelBackInteriorShadingMethod
|
|||||||
#ifndef OPENGL_TSM_H
|
#ifndef OPENGL_TSM_H
|
||||||
#define OPENGL_TSM_H
|
#define OPENGL_TSM_H
|
||||||
|
|
||||||
#define OCC1188 /* SAV 23/12/02 Added structure to control background texture
|
// OCC1188 SAV 23/12/02 Added structure to control background texture enum to control texture fill method
|
||||||
+ enum to control texture fill method
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include <TCollection_AsciiString.hxx>
|
#include <TCollection_AsciiString.hxx>
|
||||||
#include <Graphic3d_AspectMarker3d.hxx>
|
#include <Graphic3d_AspectMarker3d.hxx>
|
||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Prs3d_Text.hxx>
|
#include <Prs3d_Text.hxx>
|
||||||
|
|
||||||
void Prs3d_AnglePresentation::Draw (
|
void Prs3d_AnglePresentation::Draw (
|
||||||
@ -38,60 +38,43 @@ void Prs3d_AnglePresentation::Draw (
|
|||||||
const gp_Pnt& AttachmentPoint1,
|
const gp_Pnt& AttachmentPoint1,
|
||||||
const gp_Pnt& AttachmentPoint2,
|
const gp_Pnt& AttachmentPoint2,
|
||||||
const gp_Pnt& AttachmentPoint3,
|
const gp_Pnt& AttachmentPoint3,
|
||||||
const gp_Pnt& OffsetPoint) {
|
const gp_Pnt& OffsetPoint)
|
||||||
|
{
|
||||||
|
Handle(Prs3d_AngleAspect) AA = aDrawer->AngleAspect();
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(AA->LineAspect()->Aspect());
|
||||||
|
|
||||||
|
|
||||||
Handle(Prs3d_AngleAspect) AA = aDrawer->AngleAspect();
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(AA->LineAspect()->Aspect());
|
|
||||||
gp_Vec V1 (AttachmentPoint1,AttachmentPoint2);
|
gp_Vec V1 (AttachmentPoint1,AttachmentPoint2);
|
||||||
gp_Vec V2 (AttachmentPoint1,AttachmentPoint3);
|
gp_Vec V2 (AttachmentPoint1,AttachmentPoint3);
|
||||||
Standard_Real alpha = V1.Angle(V2);
|
const Standard_Real alpha = V1.Angle(V2);
|
||||||
Standard_Real ray = AttachmentPoint1.Distance(OffsetPoint);
|
const Standard_Real ray = AttachmentPoint1.Distance(OffsetPoint);
|
||||||
|
|
||||||
|
|
||||||
gp_Dir I (V1);
|
gp_Dir I (V1);
|
||||||
gp_Dir K = I.Crossed(gp_Dir(V2));
|
gp_Dir K = I.Crossed(gp_Dir(V2));
|
||||||
gp_Dir J = K.Crossed(I);
|
gp_Dir J = K.Crossed(I);
|
||||||
//
|
|
||||||
Standard_Real xc,yc,zc;
|
const Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
|
||||||
AttachmentPoint1.Coord(xc,yc,zc);
|
const Standard_Real dteta = alpha/(nbp-1);
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
Standard_Real x1,y1,z1,x2,y2,z2;
|
|
||||||
AttachmentPoint2.Coord(x1,y1,z1);
|
|
||||||
AttachmentPoint3.Coord(x2,y2,z2);
|
|
||||||
Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
|
|
||||||
Standard_Real dteta = alpha/(nbp-1);
|
|
||||||
Standard_Real x,y,z;
|
|
||||||
gp_Vec u;
|
gp_Vec u;
|
||||||
for (Standard_Integer i = 1; i<=nbp; i++) {
|
gp_Pnt p1, p2;
|
||||||
u = (gp_Vec(I) * Cos ( (i-1) * dteta)
|
|
||||||
+ gp_Vec(J) * Sin ( (i-1) * dteta)) * ray ;
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp+2);
|
||||||
u.Coord(x,y,z);
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
if(i == 1) {
|
for (Standard_Integer i = 1; i<=nbp; i++)
|
||||||
V(1).SetCoord( xc + x, yc + y, zc + z);
|
{
|
||||||
V(2).SetCoord( x1,y1,z1);
|
u = (gp_Vec(I) * Cos ( (i-1) * dteta)
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);}
|
+ gp_Vec(J) * Sin ( (i-1) * dteta)) * ray ;
|
||||||
else {
|
p2 = AttachmentPoint1.Translated(u);
|
||||||
V(2).SetCoord( xc + x, yc + y, zc + z);
|
aPrims->AddVertex(p2);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
if( i == nbp ) {
|
||||||
if( i == nbp ) {
|
gp_Dir dir( gp_Vec(p1,p2) );
|
||||||
Standard_Real a1,b1,c1,a2,b2,c2;
|
Prs3d_Arrow::Draw(aPresentation,p2,dir,AA->ArrowAspect()->Angle(),AA->ArrowAspect()->Length());
|
||||||
V(1).Coord(a1,b1,c1); gp_Pnt pt1(a1,b1,c1);
|
}
|
||||||
V(2).Coord(a2,b2,c2); gp_Pnt pt2(a2,b2,c2);
|
p1 = p2;
|
||||||
gp_Dir dir( gp_Vec(pt1 , pt2) );
|
|
||||||
Prs3d_Arrow::Draw(aPresentation,pt2,dir,AA->ArrowAspect()->Angle(),
|
|
||||||
AA->ArrowAspect()->Length());
|
|
||||||
}
|
|
||||||
V(1)=V(2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
V(2).SetCoord(x2,y2,z2);
|
aPrims->AddVertex(AttachmentPoint3);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
u = (gp_Vec(I) * Cos ( alpha/2.)
|
|
||||||
+ gp_Vec(J) * Sin ( alpha/2.)) * ray ;
|
u = (gp_Vec(I) * Cos (0.5*alpha)
|
||||||
u.Coord(x,y,z);
|
+ gp_Vec(J) * Sin (0.5*alpha)) * ray ;
|
||||||
Prs3d_Text::Draw(aPresentation,AA->TextAspect(),aText,
|
Prs3d_Text::Draw(aPresentation,AA->TextAspect(),aText,AttachmentPoint1.Translated(u));
|
||||||
gp_Pnt(xc+x,yc+y,zc+z));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,7 +18,8 @@
|
|||||||
|
|
||||||
#include <Prs3d_Arrow.ixx>
|
#include <Prs3d_Arrow.ixx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : Draw
|
//function : Draw
|
||||||
@ -27,10 +28,10 @@
|
|||||||
|
|
||||||
void Prs3d_Arrow::Draw(const Handle(Prs3d_Presentation)& aPresentation,
|
void Prs3d_Arrow::Draw(const Handle(Prs3d_Presentation)& aPresentation,
|
||||||
const gp_Pnt& aLocation,
|
const gp_Pnt& aLocation,
|
||||||
const gp_Dir& aDirection,
|
const gp_Dir& aDirection,
|
||||||
const Quantity_PlaneAngle anAngle,
|
const Quantity_PlaneAngle anAngle,
|
||||||
const Quantity_Length aLength) {
|
const Quantity_Length aLength)
|
||||||
|
{
|
||||||
Quantity_Length dx,dy,dz; aDirection.Coord(dx,dy,dz);
|
Quantity_Length dx,dy,dz; aDirection.Coord(dx,dy,dz);
|
||||||
//
|
//
|
||||||
// Point of the arrow:
|
// Point of the arrow:
|
||||||
@ -54,34 +55,36 @@ void Prs3d_Arrow::Draw(const Handle(Prs3d_Presentation)& aPresentation,
|
|||||||
Quantity_Length Norme = sqrt ( xi*xi + yi*yi + zi*zi );
|
Quantity_Length Norme = sqrt ( xi*xi + yi*yi + zi*zi );
|
||||||
xi = xi / Norme; yi = yi / Norme; zi = zi/Norme;
|
xi = xi / Norme; yi = yi / Norme; zi = zi/Norme;
|
||||||
|
|
||||||
Quantity_Length xj = dy * zi - dz * yi;
|
const Quantity_Length xj = dy * zi - dz * yi;
|
||||||
Quantity_Length yj = dz * xi - dx * zi;
|
const Quantity_Length yj = dz * xi - dx * zi;
|
||||||
Quantity_Length zj = dx * yi - dy * xi;
|
const Quantity_Length zj = dx * yi - dy * xi;
|
||||||
|
|
||||||
Standard_Integer NbPoints = 15;
|
const Standard_Integer NbPoints = 15;
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex VN(1,NbPoints+1);
|
Handle(Graphic3d_ArrayOfSegments) aPrims1 = new Graphic3d_ArrayOfSegments(2*NbPoints);
|
||||||
Graphic3d_Array1OfVertex V2(1,2);
|
Handle(Graphic3d_ArrayOfPolylines) aPrims2 = new Graphic3d_ArrayOfPolylines(NbPoints+1);
|
||||||
V2(1).SetCoord(xo,yo,zo);
|
|
||||||
|
|
||||||
Quantity_Length x,y,z;
|
gp_Pnt p1;
|
||||||
Standard_Real cosinus,sinus, Tg=tan(anAngle);
|
const Standard_Real Tg=tan(anAngle);
|
||||||
|
|
||||||
for (Standard_Integer i = 1 ; i <= NbPoints ; i++) {
|
for (Standard_Integer i = 1; i <= NbPoints ; i++)
|
||||||
|
{
|
||||||
|
const Standard_Real cosinus = cos ( 2 * M_PI / NbPoints * (i-1) );
|
||||||
|
const Standard_Real sinus = sin ( 2 * M_PI / NbPoints * (i-1) );
|
||||||
|
|
||||||
cosinus = cos ( 2 * M_PI / NbPoints * (i-1) );
|
const gp_Pnt pp(xc + (cosinus * xi + sinus * xj) * aLength * Tg,
|
||||||
sinus = sin ( 2 * M_PI / NbPoints * (i-1) );
|
yc + (cosinus * yi + sinus * yj) * aLength * Tg,
|
||||||
|
zc + (cosinus * zi + sinus * zj) * aLength * Tg);
|
||||||
|
|
||||||
x = xc + (cosinus * xi + sinus * xj) * aLength * Tg;
|
aPrims1->AddVertex(aLocation);
|
||||||
y = yc + (cosinus * yi + sinus * yj) * aLength * Tg;
|
aPrims1->AddVertex(pp);
|
||||||
z = zc + (cosinus * zi + sinus * zj) * aLength * Tg;
|
if(i==1) p1 = pp;
|
||||||
|
aPrims2->AddVertex(pp);
|
||||||
VN(i).SetCoord(x,y,z);
|
|
||||||
if(i==1) VN(NbPoints+1).SetCoord(x,y,z);
|
|
||||||
V2(2).SetCoord(x,y,z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V2);
|
|
||||||
}
|
}
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(VN);
|
aPrims2->AddVertex(p1);
|
||||||
|
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims1);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims2);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
@ -93,6 +96,6 @@ void Prs3d_Arrow::Fill(const Handle(Prs3d_Presentation)& /*aPresentation*/,
|
|||||||
const gp_Pnt& /*aLocation*/,
|
const gp_Pnt& /*aLocation*/,
|
||||||
const gp_Dir& /*aDirection*/,
|
const gp_Dir& /*aDirection*/,
|
||||||
const Quantity_PlaneAngle /*anAngle*/,
|
const Quantity_PlaneAngle /*anAngle*/,
|
||||||
const Quantity_Length /*aLength*/)
|
const Quantity_Length /*aLength*/)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -30,21 +30,19 @@
|
|||||||
#include <Prs3d_DatumAspect.hxx>
|
#include <Prs3d_DatumAspect.hxx>
|
||||||
#include <Prs3d_TextAspect.hxx>
|
#include <Prs3d_TextAspect.hxx>
|
||||||
#include <Prs3d_ArrowAspect.hxx>
|
#include <Prs3d_ArrowAspect.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
|
||||||
void Prs3d_Datum::Add( const Handle(Prs3d_Presentation)& aPresentation,
|
void Prs3d_Datum::Add( const Handle(Prs3d_Presentation)& aPresentation,
|
||||||
const anyDatum& aDatum,
|
const anyDatum& aDatum,
|
||||||
const Handle(Prs3d_Drawer)& aDrawer ) {
|
const Handle(Prs3d_Drawer)& aDrawer )
|
||||||
|
{
|
||||||
Handle(Prs3d_DatumAspect) DA = aDrawer->DatumAspect();
|
Handle(Prs3d_DatumAspect) DA = aDrawer->DatumAspect();
|
||||||
|
|
||||||
Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPresentation);
|
Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPresentation);
|
||||||
|
|
||||||
Quantity_Color Col; Aspect_TypeOfLine Tol; Standard_Real W;
|
Quantity_Color Col; Aspect_TypeOfLine Tol; Standard_Real W;
|
||||||
DA->FirstAxisAspect()->Aspect()->Values(Col,Tol,W);
|
DA->FirstAxisAspect()->Aspect()->Values(Col,Tol,W);
|
||||||
|
|
||||||
Handle(Graphic3d_AspectMarker3d) Asp = new Graphic3d_AspectMarker3d
|
Handle(Graphic3d_AspectMarker3d) Asp = new Graphic3d_AspectMarker3d(Aspect_TOM_BALL,Col,.1);
|
||||||
(Aspect_TOM_BALL,Col,.1);
|
|
||||||
|
|
||||||
gp_Ax2 Axis = DatumTool::Ax2(aDatum);
|
gp_Ax2 Axis = DatumTool::Ax2(aDatum);
|
||||||
gp_Pnt Orig = Axis.Location();
|
gp_Pnt Orig = Axis.Location();
|
||||||
@ -56,72 +54,63 @@ void Prs3d_Datum::Add( const Handle(Prs3d_Presentation)& aPresentation,
|
|||||||
// Trace d'une petite sphere au debut du vecteur:
|
// Trace d'une petite sphere au debut du vecteur:
|
||||||
//
|
//
|
||||||
|
|
||||||
Quantity_Length xo,yo,zo,x,y,z;
|
Quantity_Length xo,yo,zo;
|
||||||
|
|
||||||
Orig.Coord(xo,yo,zo);
|
Orig.Coord(xo,yo,zo);
|
||||||
G->SetPrimitivesAspect(Asp);
|
G->SetPrimitivesAspect(Asp);
|
||||||
G->Marker(Graphic3d_Vertex (xo,yo,zo));
|
G->Marker(Graphic3d_Vertex (xo,yo,zo));
|
||||||
|
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex A(1,2);
|
|
||||||
A(1).SetCoord(xo,yo,zo);
|
|
||||||
|
|
||||||
Quantity_Length DS;
|
Quantity_Length DS;
|
||||||
|
|
||||||
#ifdef IMP120100
|
|
||||||
Quantity_Length arrowAngle = aDrawer->ArrowAspect()->Angle();
|
Quantity_Length arrowAngle = aDrawer->ArrowAspect()->Angle();
|
||||||
Quantity_Length textHeight = aDrawer->TextAspect()->Height();
|
Quantity_Length textHeight = aDrawer->TextAspect()->Height();
|
||||||
#endif
|
|
||||||
|
|
||||||
if (DA->DrawFirstAndSecondAxis()) {
|
Handle(Graphic3d_ArrayOfSegments) aPrims;
|
||||||
oX.Coord(x,y,z);
|
if (DA->DrawFirstAndSecondAxis())
|
||||||
|
{
|
||||||
DS = DA->FirstAxisLength();
|
DS = DA->FirstAxisLength();
|
||||||
x = xo + x*DS; y = yo + y*DS; z = zo + z*DS;
|
const gp_Pnt p1(Orig.XYZ() + oX.XYZ()*DS);
|
||||||
A(2).SetCoord(x,y,z);
|
|
||||||
G->SetPrimitivesAspect(DA->FirstAxisAspect()->Aspect());
|
G->SetPrimitivesAspect(DA->FirstAxisAspect()->Aspect());
|
||||||
G->Polyline(A);
|
aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
#ifdef IMP120100
|
aPrims->AddVertex(Orig);
|
||||||
|
aPrims->AddVertex(p1);
|
||||||
|
G->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
G->SetPrimitivesAspect(aDrawer->ArrowAspect()->Aspect());
|
G->SetPrimitivesAspect(aDrawer->ArrowAspect()->Aspect());
|
||||||
Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oX,arrowAngle,DS/10.);
|
Prs3d_Arrow::Draw(aPresentation,p1,oX,arrowAngle,DS/10.);
|
||||||
G->SetPrimitivesAspect(aDrawer->TextAspect()->Aspect());
|
G->SetPrimitivesAspect(aDrawer->TextAspect()->Aspect());
|
||||||
G->Text(Standard_CString("X"),A(2),16.);
|
Graphic3d_Vertex v1(p1.X(),p1.Y(),p1.Z());
|
||||||
#else
|
G->Text(Standard_CString("X"),v1,16.);
|
||||||
Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oX,M_PI/180.*10.,DS/10.);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Text(Standard_CString("X"),A(2),1./81.);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
if (DA->DrawFirstAndSecondAxis()) {
|
|
||||||
oY.Coord(x,y,z);
|
|
||||||
DS = DA->SecondAxisLength();
|
DS = DA->SecondAxisLength();
|
||||||
x = xo + x*DS; y = yo + y*DS; z = zo + z*DS;
|
const gp_Pnt p2(Orig.XYZ() + oY.XYZ()*DS);
|
||||||
A(2).SetCoord(x,y,z);
|
|
||||||
G->SetPrimitivesAspect(DA->SecondAxisAspect()->Aspect());
|
G->SetPrimitivesAspect(DA->SecondAxisAspect()->Aspect());
|
||||||
G->Polyline(A);
|
aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
#ifdef IMP120100
|
aPrims->AddVertex(Orig);
|
||||||
|
aPrims->AddVertex(p2);
|
||||||
|
G->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
G->SetPrimitivesAspect(aDrawer->ArrowAspect()->Aspect());
|
G->SetPrimitivesAspect(aDrawer->ArrowAspect()->Aspect());
|
||||||
Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oY,arrowAngle,DS/10.);
|
Prs3d_Arrow::Draw(aPresentation,p2,oY,arrowAngle,DS/10.);
|
||||||
G->SetPrimitivesAspect(aDrawer->TextAspect()->Aspect());
|
G->SetPrimitivesAspect(aDrawer->TextAspect()->Aspect());
|
||||||
G->Text(Standard_CString("Y"),A(2),16.);
|
Graphic3d_Vertex v2(p2.X(),p2.Y(),p2.Z());
|
||||||
#else
|
G->Text(Standard_CString("Y"),v2,16.);
|
||||||
Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oY,M_PI/180.*10.,DS/10.);
|
}
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Text(Standard_CString("Y"),A(2),1./81.);
|
if (DA->DrawThirdAxis())
|
||||||
#endif
|
{
|
||||||
}
|
|
||||||
if (DA->DrawThirdAxis()) {
|
|
||||||
oZ.Coord(x,y,z);
|
|
||||||
DS = DA->ThirdAxisLength();
|
DS = DA->ThirdAxisLength();
|
||||||
x = xo + x*DS; y = yo + y*DS; z = zo + z*DS;
|
const gp_Pnt p3(Orig.XYZ() + oZ.XYZ()*DS);
|
||||||
A(2).SetCoord(x,y,z);
|
|
||||||
G->SetPrimitivesAspect(DA->ThirdAxisAspect()->Aspect());
|
G->SetPrimitivesAspect(DA->ThirdAxisAspect()->Aspect());
|
||||||
G->Polyline(A);
|
aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
#ifdef IMP120100
|
aPrims->AddVertex(Orig);
|
||||||
|
aPrims->AddVertex(p3);
|
||||||
|
G->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
G->SetPrimitivesAspect(aDrawer->ArrowAspect()->Aspect());
|
G->SetPrimitivesAspect(aDrawer->ArrowAspect()->Aspect());
|
||||||
Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oZ,arrowAngle,DS/10.);
|
Prs3d_Arrow::Draw(aPresentation,p3,oZ,arrowAngle,DS/10.);
|
||||||
G->SetPrimitivesAspect(aDrawer->TextAspect()->Aspect());
|
G->SetPrimitivesAspect(aDrawer->TextAspect()->Aspect());
|
||||||
G->Text(Standard_CString("Z"),A(2),16.);
|
Graphic3d_Vertex v3(p3.X(),p3.Y(),p3.Z());
|
||||||
#else
|
G->Text(Standard_CString("Z"),v3,16.);
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Text(Standard_CString("Z"),A(2),1./81.);
|
}
|
||||||
Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x,y,z),oZ,M_PI/180.*10.,DS/10.);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -40,7 +40,6 @@ void Prs3d_HLRShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
|
|
||||||
aGroup->SetPrimitivesAspect(aDrawer->SeenLineAspect()->Aspect());
|
aGroup->SetPrimitivesAspect(aDrawer->SeenLineAspect()->Aspect());
|
||||||
|
|
||||||
aGroup->BeginPrimitives();
|
|
||||||
Standard_Real anAngle = aDrawer->DeviationAngle();
|
Standard_Real anAngle = aDrawer->DeviationAngle();
|
||||||
TColgp_SequenceOfPnt Points;
|
TColgp_SequenceOfPnt Points;
|
||||||
for (i=1;i<=NbEdge;i++){
|
for (i=1;i<=NbEdge;i++){
|
||||||
@ -49,19 +48,17 @@ void Prs3d_HLRShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
CurvePresentation::Add(aPresentation,TheCurve,U1,U2,def, Points, anAngle);
|
CurvePresentation::Add(aPresentation,TheCurve,U1,U2,def, Points, anAngle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aGroup->EndPrimitives();
|
|
||||||
|
|
||||||
if(aDrawer->DrawHiddenLine()){
|
if(aDrawer->DrawHiddenLine())
|
||||||
|
{
|
||||||
aGroup->SetPrimitivesAspect(aDrawer->HiddenLineAspect()->Aspect());
|
aGroup->SetPrimitivesAspect(aDrawer->HiddenLineAspect()->Aspect());
|
||||||
|
|
||||||
aGroup->BeginPrimitives();
|
|
||||||
for (i=1;i<=NbEdge;i++){
|
for (i=1;i<=NbEdge;i++){
|
||||||
for(Tool.InitHidden(i);Tool.MoreHidden();Tool.NextHidden()){
|
for(Tool.InitHidden(i);Tool.MoreHidden();Tool.NextHidden()){
|
||||||
Tool.Hidden(TheCurve,U1,U2);
|
Tool.Hidden(TheCurve,U1,U2);
|
||||||
CurvePresentation::Add(aPresentation,TheCurve,U1,U2,def, Points, anAngle);
|
CurvePresentation::Add(aPresentation,TheCurve,U1,U2,def, Points, anAngle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
aGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include <TCollection_AsciiString.hxx>
|
#include <TCollection_AsciiString.hxx>
|
||||||
#include <Graphic3d_AspectMarker3d.hxx>
|
#include <Graphic3d_AspectMarker3d.hxx>
|
||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Prs3d_Text.hxx>
|
#include <Prs3d_Text.hxx>
|
||||||
|
|
||||||
void Prs3d_LengthPresentation::Draw (
|
void Prs3d_LengthPresentation::Draw (
|
||||||
@ -37,53 +37,33 @@ void Prs3d_LengthPresentation::Draw (
|
|||||||
const TCollection_ExtendedString& aText,
|
const TCollection_ExtendedString& aText,
|
||||||
const gp_Pnt& AttachmentPoint1,
|
const gp_Pnt& AttachmentPoint1,
|
||||||
const gp_Pnt& AttachmentPoint2,
|
const gp_Pnt& AttachmentPoint2,
|
||||||
const gp_Pnt& OffsetPoint) {
|
const gp_Pnt& OffsetPoint)
|
||||||
|
{
|
||||||
|
|
||||||
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
|
||||||
|
|
||||||
gp_Dir D (gp_Vec(AttachmentPoint1,AttachmentPoint2));
|
gp_Dir D (gp_Vec(AttachmentPoint1,AttachmentPoint2));
|
||||||
gp_Lin L (OffsetPoint,D);
|
gp_Lin L (OffsetPoint,D);
|
||||||
gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L,AttachmentPoint1),L);
|
gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L,AttachmentPoint1),L);
|
||||||
gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L,AttachmentPoint2),L);
|
gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L,AttachmentPoint2),L);
|
||||||
Graphic3d_Array1OfVertex V(1,2);
|
|
||||||
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(4);
|
||||||
|
aPrims->AddVertex(AttachmentPoint1);
|
||||||
|
aPrims->AddVertex(Proj1);
|
||||||
|
aPrims->AddVertex(Proj2);
|
||||||
|
aPrims->AddVertex(AttachmentPoint2);
|
||||||
|
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
|
||||||
|
|
||||||
Quantity_Length X,Y,Z;
|
Quantity_Length X,Y,Z;
|
||||||
|
|
||||||
Proj1.Coord(X,Y,Z);
|
Proj1.Coord(X,Y,Z);
|
||||||
V(1).SetCoord(X,Y,Z);
|
if (LA->DrawFirstArrow())
|
||||||
|
Prs3d_Arrow::Draw(aPresentation,Proj1,D.Reversed(),LA->Arrow1Aspect()->Angle(),LA->Arrow1Aspect()->Length());
|
||||||
|
|
||||||
AttachmentPoint1.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
|
|
||||||
Proj2.Coord(X,Y,Z);
|
|
||||||
V(2).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
AttachmentPoint2.Coord(X,Y,Z);
|
|
||||||
V(1).SetCoord(X,Y,Z);
|
|
||||||
Prs3d_Root::CurrentGroup(aPresentation)->Polyline(V);
|
|
||||||
|
|
||||||
Proj1.Coord(X,Y,Z);
|
|
||||||
if (LA->DrawFirstArrow()) {
|
|
||||||
Prs3d_Arrow::Draw(aPresentation,Proj1,D.Reversed(),
|
|
||||||
LA->Arrow1Aspect()->Angle(),
|
|
||||||
LA->Arrow1Aspect()->Length());
|
|
||||||
}
|
|
||||||
Quantity_Length X2,Y2,Z2;
|
Quantity_Length X2,Y2,Z2;
|
||||||
Proj2.Coord(X2,Y2,Z2);
|
Proj2.Coord(X2,Y2,Z2);
|
||||||
if (LA->DrawSecondArrow()) {
|
if (LA->DrawSecondArrow())
|
||||||
Prs3d_Arrow::Draw(aPresentation,Proj2,D,
|
Prs3d_Arrow::Draw(aPresentation,Proj2,D,LA->Arrow2Aspect()->Angle(),LA->Arrow2Aspect()->Length());
|
||||||
LA->Arrow2Aspect()->Angle(),
|
|
||||||
LA->Arrow2Aspect()->Length());
|
|
||||||
}
|
|
||||||
|
|
||||||
gp_Pnt p;
|
|
||||||
p.SetCoord( (X+X2)/2. , (Y+Y2)/2. , (Z+Z2)/2.);
|
|
||||||
|
|
||||||
|
gp_Pnt p( .5*(X+X2), .5*(Y+Y2), .5*(Z+Z2) );
|
||||||
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,p);
|
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Graphic3d_Vertex.hxx>
|
#include <Graphic3d_Vertex.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Prs3d_Arrow.hxx>
|
#include <Prs3d_Arrow.hxx>
|
||||||
@ -26,29 +26,25 @@
|
|||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
#include <Prs3d.hxx>
|
#include <Prs3d.hxx>
|
||||||
|
|
||||||
static void DrawLine (const anyLine& aLine,
|
static void DrawLine (const anyLine& aLine, const Handle(Graphic3d_Group)& aGroup)
|
||||||
const Handle(Graphic3d_Group)& aGroup) {
|
{
|
||||||
|
|
||||||
Standard_Integer Count=0;
|
|
||||||
Quantity_Length x,y,z;
|
Quantity_Length x,y,z;
|
||||||
|
|
||||||
Standard_Integer Lower = LineTool::Lower(aLine);
|
Standard_Integer i = LineTool::Lower(aLine);
|
||||||
Standard_Integer Upper = LineTool::Upper(aLine);
|
const Standard_Integer Upper = LineTool::Upper(aLine);
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex VertexArray(1,Upper-Lower+1);
|
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(Upper-i+1);
|
||||||
|
for (; i <= Upper; i++) {
|
||||||
for (Standard_Integer i=Lower;i<=Upper;i++){
|
|
||||||
LineTool::Coord(aLine,i,x,y,z);
|
LineTool::Coord(aLine,i,x,y,z);
|
||||||
VertexArray(++Count).SetCoord(x,y,z);
|
aPrims->AddVertex((Standard_ShortReal)x,(Standard_ShortReal)y,(Standard_ShortReal)z);
|
||||||
}
|
}
|
||||||
aGroup->Polyline(VertexArray);
|
aGroup->AddPrimitiveArray(aPrims);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Prs3d_Line::Add (const Handle (Prs3d_Presentation)& aPresentation,
|
void Prs3d_Line::Add (const Handle (Prs3d_Presentation)& aPresentation,
|
||||||
const anyLine& aLine,
|
const anyLine& aLine,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer){
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
// Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->LineAspect()->Aspect());
|
TheGroup->SetPrimitivesAspect(aDrawer->LineAspect()->Aspect());
|
||||||
DrawLine(aLine,TheGroup);
|
DrawLine(aLine,TheGroup);
|
||||||
@ -68,12 +64,10 @@ void Prs3d_Line::Add (const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void Prs3d_Line::Add (const Handle (Prs3d_Presentation)& aPresentation,
|
|
||||||
const anyLine& aLine){
|
|
||||||
|
|
||||||
|
|
||||||
|
void Prs3d_Line::Add (const Handle (Prs3d_Presentation)& aPresentation, const anyLine& aLine)
|
||||||
|
{
|
||||||
DrawLine (aLine,Prs3d_Root::CurrentGroup(aPresentation));
|
DrawLine (aLine,Prs3d_Root::CurrentGroup(aPresentation));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Integer Prs3d_Line::Pick
|
Standard_Integer Prs3d_Line::Pick
|
||||||
@ -83,46 +77,45 @@ Standard_Integer Prs3d_Line::Pick
|
|||||||
const Quantity_Length aDistance,
|
const Quantity_Length aDistance,
|
||||||
const anyLine& aLine,
|
const anyLine& aLine,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer,
|
const Handle (Prs3d_Drawer)& aDrawer,
|
||||||
const Prs3d_TypeOfLinePicking TypeOfPicking){
|
const Prs3d_TypeOfLinePicking TypeOfPicking)
|
||||||
|
{
|
||||||
|
Standard_Integer i = LineTool::Lower(aLine);
|
||||||
Standard_Integer Lower = LineTool::Lower(aLine);
|
const Standard_Integer Upper = LineTool::Upper(aLine);
|
||||||
Standard_Integer Upper = LineTool::Upper(aLine);
|
|
||||||
|
|
||||||
Standard_Integer num = 0;
|
Standard_Integer num = 0;
|
||||||
Quantity_Length X1,Y1,Z1,X2,Y2,Z2,dist;
|
Quantity_Length X1,Y1,Z1,X2,Y2,Z2,dist;
|
||||||
|
|
||||||
Standard_Real DistMin = RealLast();
|
Standard_Real DistMin = RealLast();
|
||||||
|
|
||||||
for (Standard_Integer i=Lower;i<=Upper;i++){
|
for (; i <= Upper; i++)
|
||||||
|
{
|
||||||
LineTool::Coord(aLine,i,X2,Y2,Z2);
|
LineTool::Coord(aLine,i,X2,Y2,Z2);
|
||||||
switch (TypeOfPicking) {
|
switch (TypeOfPicking) {
|
||||||
case Prs3d_TOLP_Point: {
|
case Prs3d_TOLP_Point: {
|
||||||
dist = Abs(X-X2)+Abs(Y-Y2)+ Abs(Z-Z2);
|
dist = Abs(X-X2)+Abs(Y-Y2)+ Abs(Z-Z2);
|
||||||
if(dist < aDistance) {
|
if(dist < aDistance) {
|
||||||
if (dist < DistMin) {
|
if (dist < DistMin) {
|
||||||
DistMin = dist;
|
DistMin = dist;
|
||||||
num = i;
|
num = i;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
case Prs3d_TOLP_Segment: {
|
||||||
break;
|
if (i > 1) {
|
||||||
case Prs3d_TOLP_Segment: {
|
if (Prs3d::MatchSegment(X,Y,Z,aDistance,gp_Pnt(X1,Y1,Z1),gp_Pnt(X2,Y2,Z2),dist)) {
|
||||||
if (i > 1) {
|
if(dist < aDistance) {
|
||||||
if (Prs3d::MatchSegment
|
if (dist < DistMin) {
|
||||||
(X,Y,Z,aDistance,gp_Pnt(X1,Y1,Z1),gp_Pnt(X2,Y2,Z2),dist)){
|
DistMin = dist;
|
||||||
if(dist < aDistance) {
|
num = i;
|
||||||
if (dist < DistMin) {
|
}
|
||||||
DistMin = dist;
|
}
|
||||||
num = i;
|
}
|
||||||
}
|
}
|
||||||
}
|
X1=X2;Y1=Y2;Z1=Z2;
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
X1=X2;Y1=Y2;Z1=Z2;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
|
@ -16,14 +16,13 @@
|
|||||||
// purpose or non-infringement. Please see the License for the specific terms
|
// purpose or non-infringement. Please see the License for the specific terms
|
||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
|
||||||
#include <Graphic3d_Vertex.hxx>
|
#include <Graphic3d_Vertex.hxx>
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <Prs3d_PointAspect.hxx>
|
#include <Prs3d_PointAspect.hxx>
|
||||||
|
|
||||||
static void DrawPoint (const anyPoint& aPoint,
|
static void DrawPoint (const anyPoint& aPoint,
|
||||||
const Handle(Graphic3d_Group) aGroup) {
|
const Handle(Graphic3d_Group) aGroup)
|
||||||
|
{
|
||||||
Quantity_Length x,y,z;
|
Quantity_Length x,y,z;
|
||||||
PointTool::Coord(aPoint,x,y,z);
|
PointTool::Coord(aPoint,x,y,z);
|
||||||
Graphic3d_Vertex Vertex(x,y,z);
|
Graphic3d_Vertex Vertex(x,y,z);
|
||||||
@ -32,16 +31,15 @@ static void DrawPoint (const anyPoint& aPoint,
|
|||||||
|
|
||||||
void Prs3d_Point::Add (const Handle (Prs3d_Presentation)& aPresentation,
|
void Prs3d_Point::Add (const Handle (Prs3d_Presentation)& aPresentation,
|
||||||
const anyPoint& aPoint,
|
const anyPoint& aPoint,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer){
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->PointAspect()->Aspect());
|
TheGroup->SetPrimitivesAspect(aDrawer->PointAspect()->Aspect());
|
||||||
DrawPoint(aPoint,TheGroup);
|
DrawPoint(aPoint,TheGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Prs3d_Point::Add (const Handle (Prs3d_Presentation)& aPresentation,
|
void Prs3d_Point::Add (const Handle (Prs3d_Presentation)& aPresentation, const anyPoint& aPoint)
|
||||||
const anyPoint& aPoint){
|
{
|
||||||
|
|
||||||
DrawPoint(aPoint,Prs3d_Root::CurrentGroup(aPresentation));
|
DrawPoint(aPoint,Prs3d_Root::CurrentGroup(aPresentation));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -50,8 +48,8 @@ Standard_Boolean Prs3d_Point::Match (const anyPoint& aPoint,
|
|||||||
const Quantity_Length X,
|
const Quantity_Length X,
|
||||||
const Quantity_Length Y,
|
const Quantity_Length Y,
|
||||||
const Quantity_Length Z,
|
const Quantity_Length Z,
|
||||||
const Quantity_Length aDistance) {
|
const Quantity_Length aDistance)
|
||||||
|
{
|
||||||
Quantity_Length x,y,z;
|
Quantity_Length x,y,z;
|
||||||
PointTool::Coord(aPoint,x,y,z);
|
PointTool::Coord(aPoint,x,y,z);
|
||||||
return Sqrt( (X-x)*(X-x) + (Y-y)*(Y-y) + (Z-z)*(Z-z) ) <= aDistance;
|
return Sqrt( (X-x)*(X-x) + (Y-y)*(Y-y) + (Z-z)*(Z-z) ) <= aDistance;
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include <Prs3d_LineAspect.hxx>
|
#include <Prs3d_LineAspect.hxx>
|
||||||
#include <gp_Vec.hxx>
|
#include <gp_Vec.hxx>
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
#include <Graphic3d_ArrayOfSegments.hxx>
|
||||||
|
|
||||||
|
|
||||||
void Prs3d_Vector::Add(const Handle(Prs3d_Presentation)& aPresentation,
|
void Prs3d_Vector::Add(const Handle(Prs3d_Presentation)& aPresentation,
|
||||||
@ -33,9 +33,7 @@ void Prs3d_Vector::Add(const Handle(Prs3d_Presentation)& aPresentation,
|
|||||||
{
|
{
|
||||||
gp_Pnt Pnt = VectorTool::Location(aVector);
|
gp_Pnt Pnt = VectorTool::Location(aVector);
|
||||||
gp_Vec Vec = VectorTool::Vec(aVector);
|
gp_Vec Vec = VectorTool::Vec(aVector);
|
||||||
Quantity_Length x1,y1,z1,dx,dy,dz;
|
gp_Pnt Pnt2 = Pnt.Translated(Vec);
|
||||||
Pnt.Coord(x1,y1,z1);
|
|
||||||
Vec.Coord(dx,dy,dz);
|
|
||||||
|
|
||||||
Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPresentation);
|
Handle(Graphic3d_Group) G = Prs3d_Root::CurrentGroup(aPresentation);
|
||||||
G->SetPrimitivesAspect(aDrawer->VectorAspect()->Aspect());
|
G->SetPrimitivesAspect(aDrawer->VectorAspect()->Aspect());
|
||||||
@ -43,25 +41,20 @@ void Prs3d_Vector::Add(const Handle(Prs3d_Presentation)& aPresentation,
|
|||||||
Quantity_Color Col; Aspect_TypeOfLine Tol; Standard_Real W;
|
Quantity_Color Col; Aspect_TypeOfLine Tol; Standard_Real W;
|
||||||
aDrawer->VectorAspect()->Aspect()->Values(Col,Tol,W);
|
aDrawer->VectorAspect()->Aspect()->Values(Col,Tol,W);
|
||||||
|
|
||||||
Graphic3d_Array1OfVertex A(1,2);
|
|
||||||
//
|
//
|
||||||
// Trace d'une petite sphere au debut du vecteur:
|
// Trace d'une petite sphere au debut du vecteur:
|
||||||
//
|
//
|
||||||
Graphic3d_Vertex VTX;
|
Quantity_Length x1,y1,z1;
|
||||||
VTX.SetCoord(x1,y1,z1);
|
Pnt.Coord(x1,y1,z1);
|
||||||
Handle(Graphic3d_AspectMarker3d) Asp = new Graphic3d_AspectMarker3d
|
Graphic3d_Vertex VTX(x1,y1,z1);
|
||||||
(Aspect_TOM_BALL,Col,1.);
|
Handle(Graphic3d_AspectMarker3d) Asp = new Graphic3d_AspectMarker3d(Aspect_TOM_BALL,Col,1.);
|
||||||
G->SetPrimitivesAspect(Asp);
|
G->SetPrimitivesAspect(Asp);
|
||||||
G->Marker(VTX);
|
G->Marker(VTX);
|
||||||
|
|
||||||
A(1).SetCoord(x1,y1,z1);
|
Handle(Graphic3d_ArrayOfSegments) aPrims = new Graphic3d_ArrayOfSegments(2);
|
||||||
A(2).SetCoord(x1+dx,y1+dy,z1+dz);
|
aPrims->AddVertex(Pnt);
|
||||||
G->Polyline(A);
|
aPrims->AddVertex(Pnt2);
|
||||||
Prs3d_Arrow::Draw(aPresentation,gp_Pnt(x1+dx,y1+dy,z1+dz),gp_Dir(Vec),
|
G->AddPrimitiveArray(aPrims);
|
||||||
M_PI/180.*10.,Sqrt(dx*dx+dy*dy+dz*dz)/10.);
|
|
||||||
|
|
||||||
|
Prs3d_Arrow::Draw(aPresentation,Pnt2,gp_Dir(Vec),M_PI/180.*10.,Vec.Magnitude()/10.);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
#include <Hatch_Hatcher.hxx>
|
#include <Hatch_Hatcher.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
#include <gp_Pnt2d.hxx>
|
#include <gp_Pnt2d.hxx>
|
||||||
@ -26,12 +25,6 @@
|
|||||||
#include <GCPnts_UniformDeflection.hxx>
|
#include <GCPnts_UniformDeflection.hxx>
|
||||||
#include <Adaptor3d_IsoCurve.hxx>
|
#include <Adaptor3d_IsoCurve.hxx>
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
#include <OSD_Timer.hxx>
|
|
||||||
extern OSD_Timer RestrictedFaceTimer1,RestrictedFaceTimer2,RestrictedFaceTimer3,RestrictedFaceTimer4;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// function: Add
|
// function: Add
|
||||||
@ -48,11 +41,6 @@ void Prs3d_WFDeflectionRestrictedFace::Add
|
|||||||
const Handle(Prs3d_Drawer)& aDrawer,
|
const Handle(Prs3d_Drawer)& aDrawer,
|
||||||
Prs3d_NListOfSequenceOfPnt& Curves)
|
Prs3d_NListOfSequenceOfPnt& Curves)
|
||||||
{
|
{
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
RestrictedFaceTimer1.Start();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
RestrictionTool ToolRst (aFace);
|
RestrictionTool ToolRst (aFace);
|
||||||
Standard_Real aLimit = aDrawer->MaximalParameterValue();
|
Standard_Real aLimit = aDrawer->MaximalParameterValue();
|
||||||
|
|
||||||
@ -94,12 +82,6 @@ void Prs3d_WFDeflectionRestrictedFace::Add
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
RestrictedFaceTimer1.Stop();
|
|
||||||
|
|
||||||
RestrictedFaceTimer2.Start();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// load the isos
|
// load the isos
|
||||||
Hatch_Hatcher isobuild(1.e-5,ToolRst.IsOriented());
|
Hatch_Hatcher isobuild(1.e-5,ToolRst.IsOriented());
|
||||||
Standard_Boolean UClosed = aFace->IsUClosed();
|
Standard_Boolean UClosed = aFace->IsUClosed();
|
||||||
@ -134,11 +116,6 @@ void Prs3d_WFDeflectionRestrictedFace::Add
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
RestrictedFaceTimer2.Stop();
|
|
||||||
RestrictedFaceTimer3.Start();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// trim the isos
|
// trim the isos
|
||||||
gp_Pnt2d P1,P2;
|
gp_Pnt2d P1,P2;
|
||||||
Standard_Real U1, U2;
|
Standard_Real U1, U2;
|
||||||
@ -182,13 +159,7 @@ void Prs3d_WFDeflectionRestrictedFace::Add
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
RestrictedFaceTimer3.Stop();
|
|
||||||
RestrictedFaceTimer4.Start();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// draw the isos
|
// draw the isos
|
||||||
|
|
||||||
Adaptor3d_IsoCurve anIso;
|
Adaptor3d_IsoCurve anIso;
|
||||||
anIso.Load(aFace);
|
anIso.Load(aFace);
|
||||||
Standard_Integer NumberOfLines = isobuild.NbLines();
|
Standard_Integer NumberOfLines = isobuild.NbLines();
|
||||||
@ -210,10 +181,6 @@ void Prs3d_WFDeflectionRestrictedFace::Add
|
|||||||
DrawFaceIso::Add(aPresentation,anIso,Deflection, aLimit);
|
DrawFaceIso::Add(aPresentation,anIso,Deflection, aLimit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
|
||||||
RestrictedFaceTimer4.Stop();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -359,26 +326,17 @@ Standard_Boolean Prs3d_WFDeflectionRestrictedFace::Match
|
|||||||
void Prs3d_WFDeflectionRestrictedFace::Add
|
void Prs3d_WFDeflectionRestrictedFace::Add
|
||||||
(const Handle (Prs3d_Presentation)& aPresentation,
|
(const Handle (Prs3d_Presentation)& aPresentation,
|
||||||
const Handle(BRepAdaptor_HSurface)& aFace,
|
const Handle(BRepAdaptor_HSurface)& aFace,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer){
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Quantity_Length Deflection = aDrawer->MaximalChordialDeviation();
|
|
||||||
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
|
||||||
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
|
||||||
|
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
|
|
||||||
Prs3d_WFDeflectionRestrictedFace::Add (
|
Prs3d_WFDeflectionRestrictedFace::Add (
|
||||||
aPresentation,
|
aPresentation,
|
||||||
aFace,
|
aFace,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
Deflection,
|
aDrawer->MaximalChordialDeviation(),
|
||||||
finu,
|
aDrawer->UIsoAspect()->Number(),
|
||||||
finv,
|
aDrawer->VIsoAspect()->Number(),
|
||||||
aDrawer);
|
aDrawer);
|
||||||
|
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -389,19 +347,16 @@ void Prs3d_WFDeflectionRestrictedFace::Add
|
|||||||
void Prs3d_WFDeflectionRestrictedFace::AddUIso
|
void Prs3d_WFDeflectionRestrictedFace::AddUIso
|
||||||
(const Handle (Prs3d_Presentation)& aPresentation,
|
(const Handle (Prs3d_Presentation)& aPresentation,
|
||||||
const Handle(BRepAdaptor_HSurface)& aFace,
|
const Handle(BRepAdaptor_HSurface)& aFace,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer) {
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Quantity_Length Deflection = aDrawer->MaximalChordialDeviation();
|
|
||||||
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
|
||||||
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
|
||||||
Prs3d_WFDeflectionRestrictedFace::Add (
|
Prs3d_WFDeflectionRestrictedFace::Add (
|
||||||
aPresentation,
|
aPresentation,
|
||||||
aFace,
|
aFace,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
Standard_False,
|
Standard_False,
|
||||||
Deflection,
|
aDrawer->MaximalChordialDeviation(),
|
||||||
finu,
|
aDrawer->UIsoAspect()->Number(),
|
||||||
finv,
|
aDrawer->VIsoAspect()->Number(),
|
||||||
aDrawer);
|
aDrawer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -413,19 +368,16 @@ void Prs3d_WFDeflectionRestrictedFace::AddUIso
|
|||||||
void Prs3d_WFDeflectionRestrictedFace::AddVIso
|
void Prs3d_WFDeflectionRestrictedFace::AddVIso
|
||||||
(const Handle (Prs3d_Presentation)& aPresentation,
|
(const Handle (Prs3d_Presentation)& aPresentation,
|
||||||
const Handle(BRepAdaptor_HSurface)& aFace,
|
const Handle(BRepAdaptor_HSurface)& aFace,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer) {
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Quantity_Length Deflection = aDrawer->MaximalChordialDeviation();
|
Prs3d_WFDeflectionRestrictedFace::Add (
|
||||||
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
|
||||||
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
|
||||||
Prs3d_WFDeflectionRestrictedFace::Add (
|
|
||||||
aPresentation,
|
aPresentation,
|
||||||
aFace,
|
aFace,
|
||||||
Standard_False,
|
Standard_False,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
Deflection,
|
aDrawer->MaximalChordialDeviation(),
|
||||||
finu,
|
aDrawer->UIsoAspect()->Number(),
|
||||||
finv,
|
aDrawer->VIsoAspect()->Number(),
|
||||||
aDrawer);
|
aDrawer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -440,20 +392,17 @@ Standard_Boolean Prs3d_WFDeflectionRestrictedFace::Match
|
|||||||
const Quantity_Length Z,
|
const Quantity_Length Z,
|
||||||
const Quantity_Length aDistance,
|
const Quantity_Length aDistance,
|
||||||
const Handle(BRepAdaptor_HSurface)& aFace,
|
const Handle(BRepAdaptor_HSurface)& aFace,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer){
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Quantity_Length Deflection = aDrawer->MaximalChordialDeviation();
|
|
||||||
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
|
||||||
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
|
||||||
return Prs3d_WFDeflectionRestrictedFace::Match (
|
return Prs3d_WFDeflectionRestrictedFace::Match (
|
||||||
X,Y,Z,aDistance,
|
X,Y,Z,aDistance,
|
||||||
aFace,
|
aFace,
|
||||||
aDrawer,
|
aDrawer,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
Deflection,
|
aDrawer->MaximalChordialDeviation(),
|
||||||
finu,
|
aDrawer->UIsoAspect()->Number(),
|
||||||
finv);
|
aDrawer->VIsoAspect()->Number());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -467,20 +416,20 @@ Standard_Boolean Prs3d_WFDeflectionRestrictedFace::MatchUIso
|
|||||||
const Quantity_Length Z,
|
const Quantity_Length Z,
|
||||||
const Quantity_Length aDistance,
|
const Quantity_Length aDistance,
|
||||||
const Handle(BRepAdaptor_HSurface)& aFace,
|
const Handle(BRepAdaptor_HSurface)& aFace,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer) {
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Quantity_Length Deflection = aDrawer->MaximalChordialDeviation();
|
Quantity_Length Deflection = aDrawer->MaximalChordialDeviation();
|
||||||
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
||||||
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
||||||
return Prs3d_WFDeflectionRestrictedFace::Match (
|
return Prs3d_WFDeflectionRestrictedFace::Match (
|
||||||
X,Y,Z,aDistance,
|
X,Y,Z,aDistance,
|
||||||
aFace,
|
aFace,
|
||||||
aDrawer,
|
aDrawer,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
Standard_False,
|
Standard_False,
|
||||||
Deflection,
|
Deflection,
|
||||||
finu,
|
finu,
|
||||||
finv);
|
finv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -494,20 +443,15 @@ Standard_Boolean Prs3d_WFDeflectionRestrictedFace::MatchVIso
|
|||||||
const Quantity_Length Z,
|
const Quantity_Length Z,
|
||||||
const Quantity_Length aDistance,
|
const Quantity_Length aDistance,
|
||||||
const Handle(BRepAdaptor_HSurface)& aFace,
|
const Handle(BRepAdaptor_HSurface)& aFace,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer) {
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Quantity_Length Deflection = aDrawer->MaximalChordialDeviation();
|
|
||||||
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
|
||||||
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
|
||||||
return Prs3d_WFDeflectionRestrictedFace::Match (
|
return Prs3d_WFDeflectionRestrictedFace::Match (
|
||||||
X,Y,Z,aDistance,
|
X,Y,Z,aDistance,
|
||||||
aFace,
|
aFace,
|
||||||
aDrawer,
|
aDrawer,
|
||||||
Standard_False,
|
Standard_False,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
Deflection,
|
aDrawer->MaximalChordialDeviation(),
|
||||||
finu,
|
aDrawer->UIsoAspect()->Number(),
|
||||||
finv);
|
aDrawer->VIsoAspect()->Number());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,15 +19,7 @@
|
|||||||
// and conditions governing the rights and limitations under the License.
|
// and conditions governing the rights and limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
#include <OSD_Timer.hxx>
|
|
||||||
extern OSD_Timer RestrictedFaceTimer1,RestrictedFaceTimer2,RestrictedFaceTimer3,RestrictedFaceTimer4;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <Hatch_Hatcher.hxx>
|
#include <Hatch_Hatcher.hxx>
|
||||||
#include <Graphic3d_Array1OfVertex.hxx>
|
|
||||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
|
||||||
#include <Graphic3d_Group.hxx>
|
#include <Graphic3d_Group.hxx>
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
#include <Prs3d_IsoAspect.hxx>
|
#include <Prs3d_IsoAspect.hxx>
|
||||||
@ -55,14 +47,9 @@ void Prs3d_WFRestrictedFace::Add
|
|||||||
const Handle(Prs3d_Drawer)& aDrawer,
|
const Handle(Prs3d_Drawer)& aDrawer,
|
||||||
Prs3d_NListOfSequenceOfPnt& Curves)
|
Prs3d_NListOfSequenceOfPnt& Curves)
|
||||||
{
|
{
|
||||||
Standard_Boolean isPA = Graphic3d_ArrayOfPrimitives::IsEnable();
|
|
||||||
Standard_Real aLimit = aDrawer->MaximalParameterValue();
|
Standard_Real aLimit = aDrawer->MaximalParameterValue();
|
||||||
Standard_Integer nbPoints = aDrawer->Discretisation();
|
Standard_Integer nbPoints = aDrawer->Discretisation();
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
RestrictedFaceTimer1.Start();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
RestrictionTool ToolRst (aFace);
|
RestrictionTool ToolRst (aFace);
|
||||||
|
|
||||||
// compute bounds of the restriction
|
// compute bounds of the restriction
|
||||||
@ -87,12 +74,6 @@ void Prs3d_WFRestrictedFace::Add
|
|||||||
VMax = aFace->Surface().LastVParameter();
|
VMax = aFace->Surface().LastVParameter();
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
RestrictedFaceTimer1.Stop();
|
|
||||||
|
|
||||||
RestrictedFaceTimer2.Start();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// load the isos
|
// load the isos
|
||||||
Hatch_Hatcher isobuild(1.e-5,ToolRst.IsOriented());
|
Hatch_Hatcher isobuild(1.e-5,ToolRst.IsOriented());
|
||||||
Standard_Boolean UClosed = aFace->IsUClosed();
|
Standard_Boolean UClosed = aFace->IsUClosed();
|
||||||
@ -127,11 +108,6 @@ void Prs3d_WFRestrictedFace::Add
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
RestrictedFaceTimer2.Stop();
|
|
||||||
RestrictedFaceTimer3.Start();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// trim the isos
|
// trim the isos
|
||||||
Standard_Real U1, U2, U, DU;
|
Standard_Real U1, U2, U, DU;
|
||||||
|
|
||||||
@ -165,14 +141,7 @@ void Prs3d_WFRestrictedFace::Add
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
RestrictedFaceTimer3.Stop();
|
|
||||||
RestrictedFaceTimer4.Start();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// draw the isos
|
// draw the isos
|
||||||
|
|
||||||
|
|
||||||
Adaptor3d_IsoCurve anIso;
|
Adaptor3d_IsoCurve anIso;
|
||||||
anIso.Load(aFace);
|
anIso.Load(aFace);
|
||||||
Handle(Geom_Curve) BC;
|
Handle(Geom_Curve) BC;
|
||||||
@ -207,7 +176,7 @@ void Prs3d_WFRestrictedFace::Add
|
|||||||
BC = GB->VIso(Coord);
|
BC = GB->VIso(Coord);
|
||||||
//Note that the isos are the part of the shape, it will be displayed after a computation the whole shape
|
//Note that the isos are the part of the shape, it will be displayed after a computation the whole shape
|
||||||
//NbPoints = 30 - default parameter for computation of such curves
|
//NbPoints = 30 - default parameter for computation of such curves
|
||||||
DrawFaceIso::Add(aPresentation,GeomAdaptor_Curve(BC), b1, b2, aDeflection, Pnts, 30, !isPA);
|
DrawFaceIso::Add(aPresentation,GeomAdaptor_Curve(BC), b1, b2, aDeflection, Pnts, 30, Standard_False);
|
||||||
Curves.Append(Pnts);
|
Curves.Append(Pnts);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -215,14 +184,11 @@ void Prs3d_WFRestrictedFace::Add
|
|||||||
anIso.Load(GeomAbs_IsoU,Coord,b1,b2);
|
anIso.Load(GeomAbs_IsoU,Coord,b1,b2);
|
||||||
else
|
else
|
||||||
anIso.Load(GeomAbs_IsoV,Coord,b1,b2);
|
anIso.Load(GeomAbs_IsoV,Coord,b1,b2);
|
||||||
DrawFaceIso::Add(aPresentation,anIso, aDeflection, aDrawer, Pnts, !isPA);
|
DrawFaceIso::Add(aPresentation,anIso, aDeflection, aDrawer, Pnts, Standard_False);
|
||||||
Curves.Append(Pnts);
|
Curves.Append(Pnts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
|
||||||
RestrictedFaceTimer4.Stop();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -380,12 +346,10 @@ Standard_Boolean Prs3d_WFRestrictedFace::Match
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return Standard_False;
|
||||||
return Standard_False;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// function: Add
|
// function: Add
|
||||||
// purpose
|
// purpose
|
||||||
@ -393,27 +357,19 @@ Standard_Boolean Prs3d_WFRestrictedFace::Match
|
|||||||
void Prs3d_WFRestrictedFace::Add
|
void Prs3d_WFRestrictedFace::Add
|
||||||
(const Handle (Prs3d_Presentation)& aPresentation,
|
(const Handle (Prs3d_Presentation)& aPresentation,
|
||||||
const Handle(BRepAdaptor_HSurface)& aFace,
|
const Handle(BRepAdaptor_HSurface)& aFace,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer){
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
|
||||||
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
|
||||||
Quantity_Length aDeflection = aDrawer->MaximalChordialDeviation();
|
|
||||||
|
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
Prs3d_NListOfSequenceOfPnt Curves;
|
Prs3d_NListOfSequenceOfPnt Curves;
|
||||||
Prs3d_WFRestrictedFace::Add (
|
Prs3d_WFRestrictedFace::Add (
|
||||||
aPresentation,
|
aPresentation,
|
||||||
aFace,
|
aFace,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
aDeflection,
|
aDrawer->MaximalChordialDeviation(),
|
||||||
finu,
|
aDrawer->UIsoAspect()->Number(),
|
||||||
finv,
|
aDrawer->VIsoAspect()->Number(),
|
||||||
aDrawer,
|
aDrawer,
|
||||||
Curves);
|
Curves);
|
||||||
|
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -424,20 +380,17 @@ void Prs3d_WFRestrictedFace::Add
|
|||||||
void Prs3d_WFRestrictedFace::AddUIso
|
void Prs3d_WFRestrictedFace::AddUIso
|
||||||
(const Handle (Prs3d_Presentation)& aPresentation,
|
(const Handle (Prs3d_Presentation)& aPresentation,
|
||||||
const Handle(BRepAdaptor_HSurface)& aFace,
|
const Handle(BRepAdaptor_HSurface)& aFace,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer) {
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
|
||||||
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
|
||||||
Quantity_Length aDeflection = aDrawer->MaximalChordialDeviation();
|
|
||||||
Prs3d_NListOfSequenceOfPnt Curves;
|
Prs3d_NListOfSequenceOfPnt Curves;
|
||||||
Prs3d_WFRestrictedFace::Add (
|
Prs3d_WFRestrictedFace::Add (
|
||||||
aPresentation,
|
aPresentation,
|
||||||
aFace,
|
aFace,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
Standard_False,
|
Standard_False,
|
||||||
aDeflection,
|
aDrawer->MaximalChordialDeviation(),
|
||||||
finu,
|
aDrawer->UIsoAspect()->Number(),
|
||||||
finv,
|
aDrawer->VIsoAspect()->Number(),
|
||||||
aDrawer,
|
aDrawer,
|
||||||
Curves);
|
Curves);
|
||||||
}
|
}
|
||||||
@ -450,20 +403,17 @@ void Prs3d_WFRestrictedFace::AddUIso
|
|||||||
void Prs3d_WFRestrictedFace::AddVIso
|
void Prs3d_WFRestrictedFace::AddVIso
|
||||||
(const Handle (Prs3d_Presentation)& aPresentation,
|
(const Handle (Prs3d_Presentation)& aPresentation,
|
||||||
const Handle(BRepAdaptor_HSurface)& aFace,
|
const Handle(BRepAdaptor_HSurface)& aFace,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer) {
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
|
||||||
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
|
||||||
Quantity_Length aDeflection = aDrawer->MaximalChordialDeviation();
|
|
||||||
Prs3d_NListOfSequenceOfPnt Curves;
|
Prs3d_NListOfSequenceOfPnt Curves;
|
||||||
Prs3d_WFRestrictedFace::Add (
|
Prs3d_WFRestrictedFace::Add (
|
||||||
aPresentation,
|
aPresentation,
|
||||||
aFace,
|
aFace,
|
||||||
Standard_False,
|
Standard_False,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
aDeflection,
|
aDrawer->MaximalChordialDeviation(),
|
||||||
finu,
|
aDrawer->UIsoAspect()->Number(),
|
||||||
finv,
|
aDrawer->VIsoAspect()->Number(),
|
||||||
aDrawer,
|
aDrawer,
|
||||||
Curves);
|
Curves);
|
||||||
}
|
}
|
||||||
@ -479,20 +429,17 @@ Standard_Boolean Prs3d_WFRestrictedFace::Match
|
|||||||
const Quantity_Length Z,
|
const Quantity_Length Z,
|
||||||
const Quantity_Length aDistance,
|
const Quantity_Length aDistance,
|
||||||
const Handle(BRepAdaptor_HSurface)& aFace,
|
const Handle(BRepAdaptor_HSurface)& aFace,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer){
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
|
||||||
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
|
||||||
Quantity_Length aDeflection = aDrawer->MaximalChordialDeviation();
|
|
||||||
return Prs3d_WFRestrictedFace::Match (
|
return Prs3d_WFRestrictedFace::Match (
|
||||||
X,Y,Z,aDistance,
|
X,Y,Z,aDistance,
|
||||||
aFace,
|
aFace,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
aDeflection,
|
aDrawer->MaximalChordialDeviation(),
|
||||||
finu,
|
aDrawer->UIsoAspect()->Number(),
|
||||||
finv,
|
aDrawer->VIsoAspect()->Number(),
|
||||||
aDrawer);
|
aDrawer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -506,20 +453,17 @@ Standard_Boolean Prs3d_WFRestrictedFace::MatchUIso
|
|||||||
const Quantity_Length Z,
|
const Quantity_Length Z,
|
||||||
const Quantity_Length aDistance,
|
const Quantity_Length aDistance,
|
||||||
const Handle(BRepAdaptor_HSurface)& aFace,
|
const Handle(BRepAdaptor_HSurface)& aFace,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer) {
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
|
||||||
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
|
||||||
Quantity_Length aDeflection = aDrawer->MaximalChordialDeviation();
|
|
||||||
return Prs3d_WFRestrictedFace::Match (
|
return Prs3d_WFRestrictedFace::Match (
|
||||||
X,Y,Z,aDistance,
|
X,Y,Z,aDistance,
|
||||||
aFace,
|
aFace,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
Standard_False,
|
Standard_False,
|
||||||
aDeflection,
|
aDrawer->MaximalChordialDeviation(),
|
||||||
finu,
|
aDrawer->UIsoAspect()->Number(),
|
||||||
finv,
|
aDrawer->VIsoAspect()->Number(),
|
||||||
aDrawer);
|
aDrawer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -533,18 +477,15 @@ Standard_Boolean Prs3d_WFRestrictedFace::MatchVIso
|
|||||||
const Quantity_Length Z,
|
const Quantity_Length Z,
|
||||||
const Quantity_Length aDistance,
|
const Quantity_Length aDistance,
|
||||||
const Handle(BRepAdaptor_HSurface)& aFace,
|
const Handle(BRepAdaptor_HSurface)& aFace,
|
||||||
const Handle (Prs3d_Drawer)& aDrawer) {
|
const Handle (Prs3d_Drawer)& aDrawer)
|
||||||
|
{
|
||||||
Standard_Integer finu = aDrawer->UIsoAspect()->Number();
|
|
||||||
Standard_Integer finv = aDrawer->VIsoAspect()->Number();
|
|
||||||
Quantity_Length aDeflection = aDrawer->MaximalChordialDeviation();
|
|
||||||
return Prs3d_WFRestrictedFace::Match (
|
return Prs3d_WFRestrictedFace::Match (
|
||||||
X,Y,Z,aDistance,
|
X,Y,Z,aDistance,
|
||||||
aFace,
|
aFace,
|
||||||
Standard_False,
|
Standard_False,
|
||||||
Standard_True,
|
Standard_True,
|
||||||
aDeflection,
|
aDrawer->MaximalChordialDeviation(),
|
||||||
finu,
|
aDrawer->UIsoAspect()->Number(),
|
||||||
finv,
|
aDrawer->VIsoAspect()->Number(),
|
||||||
aDrawer);
|
aDrawer);
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,6 @@
|
|||||||
#include <BRepAdaptor_HSurface.hxx>
|
#include <BRepAdaptor_HSurface.hxx>
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
#include <Graphic3d_AspectLine3d.hxx>
|
#include <Graphic3d_AspectLine3d.hxx>
|
||||||
#include <Graphic3d_ArrayOfPrimitives.hxx>
|
|
||||||
#include <Graphic3d_ArrayOfPolylines.hxx>
|
#include <Graphic3d_ArrayOfPolylines.hxx>
|
||||||
#include <Poly_Connect.hxx>
|
#include <Poly_Connect.hxx>
|
||||||
|
|
||||||
@ -55,14 +54,6 @@
|
|||||||
#include <Prs3d_NListOfSequenceOfPnt.hxx>
|
#include <Prs3d_NListOfSequenceOfPnt.hxx>
|
||||||
#include <Prs3d_NListIteratorOfListOfSequenceOfPnt.hxx>
|
#include <Prs3d_NListIteratorOfListOfSequenceOfPnt.hxx>
|
||||||
|
|
||||||
#ifdef DEB_MESH
|
|
||||||
#include <OSD_Timer.hxx>
|
|
||||||
extern OSD_Timer RestrictedFaceTimer1,RestrictedFaceTimer2,RestrictedFaceTimer3,RestrictedFaceTimer4;
|
|
||||||
extern OSD_Timer ShapeTimer;
|
|
||||||
extern OSD_Timer FaceExplorerTimer, CurveExplorerTimer;
|
|
||||||
extern OSD_Timer UIsoTimer,VIsoTimer,WireTimer,FreeBoundaryTimer,UnFreeBoundaryTimer;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static Standard_Boolean IsSame(const Handle(Graphic3d_AspectLine3d)& UAspect,
|
static Standard_Boolean IsSame(const Handle(Graphic3d_AspectLine3d)& UAspect,
|
||||||
const Handle(Graphic3d_AspectLine3d)& VAspect)
|
const Handle(Graphic3d_AspectLine3d)& VAspect)
|
||||||
{
|
{
|
||||||
@ -84,50 +75,29 @@ static Standard_Boolean IsSame(const Handle(Graphic3d_AspectLine3d)& UAspect,
|
|||||||
|
|
||||||
|
|
||||||
static Standard_Boolean AddPolygon(const TopoDS_Edge& E,
|
static Standard_Boolean AddPolygon(const TopoDS_Edge& E,
|
||||||
Handle(Graphic3d_Group)& TheGroup,
|
Handle(Graphic3d_Group)& TheGroup,
|
||||||
const Standard_Real deflection,
|
const Standard_Real deflection,
|
||||||
const Handle (Prs3d_Drawer)& ,
|
const Handle (Prs3d_Drawer)& ,
|
||||||
TColgp_SequenceOfPnt& Pnts)
|
TColgp_SequenceOfPnt& Pnts)
|
||||||
{
|
{
|
||||||
TopLoc_Location l;
|
TopLoc_Location l;
|
||||||
gp_Pnt P;
|
|
||||||
Standard_Boolean result = Standard_False;
|
|
||||||
Standard_Boolean IsPrimArray = Graphic3d_ArrayOfPrimitives::IsEnable();
|
|
||||||
Standard_Boolean OK;
|
|
||||||
Standard_Real fi, la;
|
Standard_Real fi, la;
|
||||||
|
|
||||||
Handle(Poly_Polygon3D) Polyg;
|
|
||||||
Handle(Geom_Curve) CC3d = BRep_Tool::Curve(E, fi, la);
|
Handle(Geom_Curve) CC3d = BRep_Tool::Curve(E, fi, la);
|
||||||
|
Handle(Poly_Polygon3D) Polyg = BRep_Tool::Polygon3D(E, l);
|
||||||
|
|
||||||
Polyg = BRep_Tool::Polygon3D(E, l);
|
|
||||||
if (!Polyg.IsNull()) {
|
if (!Polyg.IsNull()) {
|
||||||
OK = Polyg->Deflection() <= deflection;
|
if ((Polyg->Deflection() <= deflection) || CC3d.IsNull()) {
|
||||||
OK = OK || (CC3d.IsNull());
|
|
||||||
|
|
||||||
if (OK) {
|
|
||||||
result = Standard_True;
|
|
||||||
const TColgp_Array1OfPnt& Points = Polyg->Nodes();
|
const TColgp_Array1OfPnt& Points = Polyg->Nodes();
|
||||||
Graphic3d_Array1OfVertex V(1, Points.Length());
|
Standard_Integer po = Points.Lower();
|
||||||
Standard_Integer po, ii = 1;
|
|
||||||
if (l.IsIdentity()) {
|
if (l.IsIdentity()) {
|
||||||
for (po = Points.Lower(); po <= Points.Upper(); po++) {
|
for (; po <= Points.Upper(); po++)
|
||||||
P = Points.Value(po);
|
Pnts.Append(Points.Value(po));
|
||||||
V(ii).SetCoord(P.X(), P.Y(), P.Z());
|
|
||||||
Pnts.Append(P);
|
|
||||||
ii++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (po = Points.Lower(); po <= Points.Upper(); po++) {
|
for (; po <= Points.Upper(); po++)
|
||||||
P = Points.Value(po).Transformed(l);
|
Pnts.Append(Points.Value(po).Transformed(l));
|
||||||
V(ii).SetCoord(P.X(), P.Y(), P.Z());
|
|
||||||
Pnts.Append(P);
|
|
||||||
ii++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(!IsPrimArray)
|
return Standard_True;
|
||||||
TheGroup->Polyline(V);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,46 +105,26 @@ static Standard_Boolean AddPolygon(const TopoDS_Edge& E,
|
|||||||
Handle(Poly_PolygonOnTriangulation) HIndices;
|
Handle(Poly_PolygonOnTriangulation) HIndices;
|
||||||
BRep_Tool::PolygonOnTriangulation(E, HIndices, Tr, l);
|
BRep_Tool::PolygonOnTriangulation(E, HIndices, Tr, l);
|
||||||
if (!HIndices.IsNull()) {
|
if (!HIndices.IsNull()) {
|
||||||
|
if ((HIndices->Deflection() <= deflection) || CC3d.IsNull()) {
|
||||||
OK = HIndices->Deflection() <= deflection;
|
|
||||||
OK = OK || (CC3d.IsNull());
|
|
||||||
|
|
||||||
if (OK) {
|
|
||||||
result = Standard_True;
|
|
||||||
const TColStd_Array1OfInteger& Indices = HIndices->Nodes();
|
const TColStd_Array1OfInteger& Indices = HIndices->Nodes();
|
||||||
const TColgp_Array1OfPnt& Nodes = Tr->Nodes();
|
const TColgp_Array1OfPnt& Nodes = Tr->Nodes();
|
||||||
Graphic3d_Array1OfVertex V(1, Indices.Length());
|
|
||||||
|
|
||||||
Standard_Integer po, ii = 1;
|
Standard_Integer po = Indices.Lower();
|
||||||
if (l.IsIdentity()) {
|
if (l.IsIdentity()) {
|
||||||
for (po = Indices.Lower(); po <= Indices.Upper(); po++) {
|
for (; po <= Indices.Upper(); po++)
|
||||||
P = Nodes(Indices(po));
|
Pnts.Append(Nodes(Indices(po)));
|
||||||
V(ii).SetCoord(P.X(), P.Y(), P.Z());
|
|
||||||
Pnts.Append(P);
|
|
||||||
ii++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (po = Indices.Lower(); po <= Indices.Upper(); po++) {
|
for (; po <= Indices.Upper(); po++)
|
||||||
P = Nodes(Indices(po)).Transformed(l);
|
Pnts.Append(Nodes(Indices(po)).Transformed(l));
|
||||||
V(ii).SetCoord(P.X(), P.Y(), P.Z());
|
|
||||||
Pnts.Append(P);
|
|
||||||
ii++;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if(!IsPrimArray)
|
return Standard_True;
|
||||||
TheGroup->Polyline(V);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=========================================================================
|
//=========================================================================
|
||||||
// function: Add
|
// function: Add
|
||||||
// purpose
|
// purpose
|
||||||
@ -185,17 +135,6 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
{
|
{
|
||||||
if (aShape.IsNull()) return;
|
if (aShape.IsNull()) return;
|
||||||
|
|
||||||
Standard_Boolean isPrimArrayEnabled = Graphic3d_ArrayOfPrimitives::IsEnable();
|
|
||||||
#ifdef DEB_MESH
|
|
||||||
RestrictedFaceTimer1.Reset();
|
|
||||||
RestrictedFaceTimer2.Reset();
|
|
||||||
RestrictedFaceTimer3.Reset();
|
|
||||||
RestrictedFaceTimer4.Reset();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEB_MESH
|
|
||||||
ShapeTimer.Start();
|
|
||||||
#endif
|
|
||||||
Prs3d_ShapeTool Tool(aShape);
|
Prs3d_ShapeTool Tool(aShape);
|
||||||
TopTools_ListOfShape LFree, LUnFree, LWire;
|
TopTools_ListOfShape LFree, LUnFree, LWire;
|
||||||
for (Tool.InitCurve();Tool.MoreCurve();Tool.NextCurve())
|
for (Tool.InitCurve();Tool.MoreCurve();Tool.NextCurve())
|
||||||
@ -208,13 +147,6 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
default: LUnFree.Append(E);
|
default: LUnFree.Append(E);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef DEB_MESH
|
|
||||||
ShapeTimer.Stop();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef DEB_MESH
|
|
||||||
RestrictedFaceTimer1.Start();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Standard_Real aDeflection;
|
Standard_Real aDeflection;
|
||||||
if (aDrawer->TypeOfDeflection() == Aspect_TOD_RELATIVE)
|
if (aDrawer->TypeOfDeflection() == Aspect_TOD_RELATIVE)
|
||||||
@ -235,10 +167,6 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
else
|
else
|
||||||
aDeflection = aDrawer->MaximalChordialDeviation();
|
aDeflection = aDrawer->MaximalChordialDeviation();
|
||||||
|
|
||||||
#ifdef DEB_MESH
|
|
||||||
RestrictedFaceTimer1.Stop();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
|
||||||
|
|
||||||
Prs3d_NListOfSequenceOfPnt UIsoCurves;
|
Prs3d_NListOfSequenceOfPnt UIsoCurves;
|
||||||
@ -252,15 +180,8 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
{
|
{
|
||||||
const Standard_Integer isoU = aDrawer->UIsoAspect()->Number();
|
const Standard_Integer isoU = aDrawer->UIsoAspect()->Number();
|
||||||
const Standard_Integer isoV = aDrawer->VIsoAspect()->Number();
|
const Standard_Integer isoV = aDrawer->VIsoAspect()->Number();
|
||||||
#ifdef DEB_MESH
|
|
||||||
UIsoTimer.Start();
|
|
||||||
#endif
|
|
||||||
if (isoU || isoV)
|
if (isoU || isoV)
|
||||||
{
|
{
|
||||||
if(!isPrimArrayEnabled) {
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->UIsoAspect()->Aspect());
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
}
|
|
||||||
BRepAdaptor_Surface S;
|
BRepAdaptor_Surface S;
|
||||||
for (Tool.InitFace();Tool.MoreFace();Tool.NextFace())
|
for (Tool.InitFace();Tool.MoreFace();Tool.NextFace())
|
||||||
{
|
{
|
||||||
@ -285,34 +206,18 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
}
|
}
|
||||||
catch (Standard_Failure)
|
catch (Standard_Failure)
|
||||||
{
|
{
|
||||||
#ifdef DEB_MESH
|
|
||||||
const TopoDS_Face& FF = S.Face();
|
|
||||||
cout <<"probleme pour les isos de la face "<< (void*) &(*(FF).TShape()) << endl;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!isPrimArrayEnabled)
|
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
#ifdef DEB_MESH
|
|
||||||
UIsoTimer.Stop();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const Standard_Integer isoU = aDrawer->UIsoAspect()->Number();
|
const Standard_Integer isoU = aDrawer->UIsoAspect()->Number();
|
||||||
const Standard_Integer isoV = aDrawer->VIsoAspect()->Number();
|
const Standard_Integer isoV = aDrawer->VIsoAspect()->Number();
|
||||||
#ifdef DEB_MESH
|
|
||||||
UIsoTimer.Start();
|
|
||||||
#endif
|
|
||||||
if (isoU)
|
if (isoU)
|
||||||
{
|
{
|
||||||
if(!isPrimArrayEnabled) {
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->UIsoAspect()->Aspect());
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
}
|
|
||||||
BRepAdaptor_Surface S;
|
BRepAdaptor_Surface S;
|
||||||
for (Tool.InitFace();Tool.MoreFace();Tool.NextFace())
|
for (Tool.InitFace();Tool.MoreFace();Tool.NextFace())
|
||||||
{
|
{
|
||||||
@ -343,19 +248,9 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!isPrimArrayEnabled)
|
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
#ifdef DEB_MESH
|
|
||||||
UIsoTimer.Stop();
|
|
||||||
VIsoTimer.Start();
|
|
||||||
#endif
|
|
||||||
if (isoV)
|
if (isoV)
|
||||||
{
|
{
|
||||||
if(!isPrimArrayEnabled) {
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->VIsoAspect()->Aspect());
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
}
|
|
||||||
BRepAdaptor_Surface S;
|
BRepAdaptor_Surface S;
|
||||||
for (Tool.InitFace();Tool.MoreFace();Tool.NextFace())
|
for (Tool.InitFace();Tool.MoreFace();Tool.NextFace())
|
||||||
{
|
{
|
||||||
@ -386,65 +281,48 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isPrimArrayEnabled) TheGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
#ifdef DEB_MESH
|
|
||||||
VIsoTimer.Stop();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
Standard_Integer nbVertices = 0, nbBounds = 0;
|
Standard_Integer nbVertices = 0, nbBounds = 0;
|
||||||
|
|
||||||
if(isPrimArrayEnabled) {
|
if(UIsoCurves.Size() > 0) {
|
||||||
if(UIsoCurves.Size() > 0) {
|
nbBounds = UIsoCurves.Size();
|
||||||
nbBounds = UIsoCurves.Size();
|
Prs3d_NListIteratorOfListOfSequenceOfPnt It;
|
||||||
Prs3d_NListIteratorOfListOfSequenceOfPnt It;
|
for( It.Init(UIsoCurves); It.More(); It.Next())
|
||||||
for( It.Init(UIsoCurves); It.More(); It.Next())
|
nbVertices += It.Value().Length();
|
||||||
nbVertices += It.Value().Length();
|
Handle(Graphic3d_ArrayOfPolylines) UIsoArray =
|
||||||
Handle(Graphic3d_ArrayOfPolylines) UIsoArray =
|
new Graphic3d_ArrayOfPolylines(nbVertices,nbBounds);
|
||||||
new Graphic3d_ArrayOfPolylines(nbVertices,nbBounds);
|
for( It.Init(UIsoCurves); It.More(); It.Next()) {
|
||||||
for( It.Init(UIsoCurves); It.More(); It.Next()) {
|
TColgp_SequenceOfPnt Pnts;
|
||||||
TColgp_SequenceOfPnt Pnts;
|
Pnts.Assign(It.Value());
|
||||||
Pnts.Assign(It.Value());
|
UIsoArray->AddBound(Pnts.Length());
|
||||||
UIsoArray->AddBound(Pnts.Length());
|
for(int i=1; i<=Pnts.Length(); i++)
|
||||||
for(int i=1; i<=Pnts.Length(); i++)
|
UIsoArray->AddVertex(Pnts.Value(i));
|
||||||
UIsoArray->AddVertex(Pnts.Value(i));
|
|
||||||
}
|
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->UIsoAspect()->Aspect());
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
TheGroup->AddPrimitiveArray(UIsoArray);
|
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
||||||
if(VIsoCurves.Size() > 0) {
|
|
||||||
nbBounds = VIsoCurves.Size();
|
|
||||||
Prs3d_NListIteratorOfListOfSequenceOfPnt It;
|
|
||||||
for( It.Init(VIsoCurves); It.More(); It.Next())
|
|
||||||
nbVertices += It.Value().Length();
|
|
||||||
Handle(Graphic3d_ArrayOfPolylines) VIsoArray =
|
|
||||||
new Graphic3d_ArrayOfPolylines(nbVertices,nbBounds);
|
|
||||||
for( It.Init(VIsoCurves); It.More(); It.Next()) {
|
|
||||||
TColgp_SequenceOfPnt Pnts;
|
|
||||||
Pnts.Assign(It.Value());
|
|
||||||
VIsoArray->AddBound(Pnts.Length());
|
|
||||||
for(int i=1; i<=Pnts.Length(); i++)
|
|
||||||
VIsoArray->AddVertex(Pnts.Value(i));
|
|
||||||
}
|
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->VIsoAspect()->Aspect());
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
TheGroup->AddPrimitiveArray(VIsoArray);
|
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEB_MESH
|
|
||||||
WireTimer.Start();
|
|
||||||
#endif
|
|
||||||
if(!isPrimArrayEnabled) {
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->UIsoAspect()->Aspect());
|
TheGroup->SetPrimitivesAspect(aDrawer->UIsoAspect()->Aspect());
|
||||||
TheGroup->BeginPrimitives();
|
TheGroup->AddPrimitiveArray(UIsoArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(VIsoCurves.Size() > 0) {
|
||||||
|
nbBounds = VIsoCurves.Size();
|
||||||
|
Prs3d_NListIteratorOfListOfSequenceOfPnt It;
|
||||||
|
for( It.Init(VIsoCurves); It.More(); It.Next())
|
||||||
|
nbVertices += It.Value().Length();
|
||||||
|
Handle(Graphic3d_ArrayOfPolylines) VIsoArray =
|
||||||
|
new Graphic3d_ArrayOfPolylines(nbVertices,nbBounds);
|
||||||
|
for( It.Init(VIsoCurves); It.More(); It.Next()) {
|
||||||
|
TColgp_SequenceOfPnt Pnts;
|
||||||
|
Pnts.Assign(It.Value());
|
||||||
|
VIsoArray->AddBound(Pnts.Length());
|
||||||
|
for(int i=1; i<=Pnts.Length(); i++)
|
||||||
|
VIsoArray->AddVertex(Pnts.Value(i));
|
||||||
|
}
|
||||||
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
TheGroup->SetPrimitivesAspect(aDrawer->VIsoAspect()->Aspect());
|
||||||
|
TheGroup->AddPrimitiveArray(VIsoArray);
|
||||||
|
}
|
||||||
|
|
||||||
gp_Pnt P;
|
gp_Pnt P;
|
||||||
TopLoc_Location l;
|
TopLoc_Location l;
|
||||||
Graphic3d_Vertex V1, V2;
|
Graphic3d_Vertex V1, V2;
|
||||||
@ -514,11 +392,6 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
gp_Pnt P2 = Nodes(Free(2*i)).Transformed(l);
|
gp_Pnt P2 = Nodes(Free(2*i)).Transformed(l);
|
||||||
SurfPnts.Append(P1);
|
SurfPnts.Append(P1);
|
||||||
SurfPnts.Append(P2);
|
SurfPnts.Append(P2);
|
||||||
if(!isPrimArrayEnabled) {
|
|
||||||
V1.SetCoord(P1.X(), P1.Y(), P1.Z());
|
|
||||||
V2.SetCoord(P2.X(), P2.Y(), P2.Z());
|
|
||||||
TheGroup->Polyline(V1, V2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(DispTriangles) {
|
if(DispTriangles) {
|
||||||
@ -527,19 +400,12 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
gp_Pnt P2 = Nodes(Internal(2*i)).Transformed(l);
|
gp_Pnt P2 = Nodes(Internal(2*i)).Transformed(l);
|
||||||
SurfPnts.Append(P1);
|
SurfPnts.Append(P1);
|
||||||
SurfPnts.Append(P2);
|
SurfPnts.Append(P2);
|
||||||
if(!isPrimArrayEnabled) {
|
|
||||||
V1.SetCoord(P1.X(), P1.Y(), P1.Z());
|
|
||||||
V2.SetCoord(P2.X(), P2.Y(), P2.Z());
|
|
||||||
TheGroup->Polyline(V1, V2);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!isPrimArrayEnabled)
|
if(SurfPnts.Length()>0){
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
if(isPrimArrayEnabled && SurfPnts.Length()>0){
|
|
||||||
nbVertices = SurfPnts.Length();
|
nbVertices = SurfPnts.Length();
|
||||||
nbBounds = (Standard_Integer)nbVertices / 2;
|
nbBounds = (Standard_Integer)nbVertices / 2;
|
||||||
Handle(Graphic3d_ArrayOfPolylines) SurfArray =
|
Handle(Graphic3d_ArrayOfPolylines) SurfArray =
|
||||||
@ -550,15 +416,11 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
SurfArray->AddVertex(SurfPnts.Value(i+1));
|
SurfArray->AddVertex(SurfPnts.Value(i+1));
|
||||||
}
|
}
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
||||||
if(DispTriangles && Tool.HasSurface()) {
|
if(DispTriangles && Tool.HasSurface())
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->UIsoAspect()->Aspect());
|
TheGroup->SetPrimitivesAspect(aDrawer->UIsoAspect()->Aspect());
|
||||||
}
|
else
|
||||||
else {
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->FreeBoundaryAspect()->Aspect());
|
TheGroup->SetPrimitivesAspect(aDrawer->FreeBoundaryAspect()->Aspect());
|
||||||
}
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
TheGroup->AddPrimitiveArray(SurfArray);
|
TheGroup->AddPrimitiveArray(SurfArray);
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
TopTools_ListIteratorOfListOfShape It;
|
TopTools_ListIteratorOfListOfShape It;
|
||||||
|
|
||||||
@ -566,7 +428,6 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
{
|
{
|
||||||
// Wire (without any neighbour)
|
// Wire (without any neighbour)
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->WireAspect()->Aspect());
|
TheGroup->SetPrimitivesAspect(aDrawer->WireAspect()->Aspect());
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
for (It.Initialize(LWire); It.More(); It.Next()) {
|
for (It.Initialize(LWire); It.More(); It.Next()) {
|
||||||
const TopoDS_Edge& E = TopoDS::Edge(It.Value());
|
const TopoDS_Edge& E = TopoDS::Edge(It.Value());
|
||||||
try
|
try
|
||||||
@ -576,7 +437,7 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
if (!AddPolygon(E, TheGroup, aDeflection, aDrawer, Pnts)) {
|
if (!AddPolygon(E, TheGroup, aDeflection, aDrawer, Pnts)) {
|
||||||
if (BRep_Tool::IsGeometric(E)) {
|
if (BRep_Tool::IsGeometric(E)) {
|
||||||
BRepAdaptor_Curve C(E);
|
BRepAdaptor_Curve C(E);
|
||||||
CurvePresentation::Add(aPresentation, C, aDeflection, aDrawer, Pnts, !isPrimArrayEnabled);
|
CurvePresentation::Add(aPresentation, C, aDeflection, aDrawer, Pnts, Standard_False);
|
||||||
WireCurves.Append(Pnts);
|
WireCurves.Append(Pnts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -590,21 +451,11 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEB_MESH
|
|
||||||
WireTimer.Stop();
|
|
||||||
FreeBoundaryTimer.Start();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (aDrawer->FreeBoundaryDraw())
|
if (aDrawer->FreeBoundaryDraw())
|
||||||
{
|
{
|
||||||
// Free boundaries;
|
// Free boundaries;
|
||||||
if(!isPrimArrayEnabled) {
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->FreeBoundaryAspect()->Aspect());
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
}
|
|
||||||
for (It.Initialize(LFree); It.More(); It.Next()) {
|
for (It.Initialize(LFree); It.More(); It.Next()) {
|
||||||
const TopoDS_Edge& E = TopoDS::Edge(It.Value());
|
const TopoDS_Edge& E = TopoDS::Edge(It.Value());
|
||||||
if (!BRep_Tool::Degenerated(E)) {
|
if (!BRep_Tool::Degenerated(E)) {
|
||||||
@ -614,7 +465,7 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
if (!AddPolygon(E, TheGroup, aDeflection, aDrawer, Pnts)) {
|
if (!AddPolygon(E, TheGroup, aDeflection, aDrawer, Pnts)) {
|
||||||
if (BRep_Tool::IsGeometric(E)) {
|
if (BRep_Tool::IsGeometric(E)) {
|
||||||
BRepAdaptor_Curve C(E);
|
BRepAdaptor_Curve C(E);
|
||||||
CurvePresentation::Add(aPresentation, C, aDeflection, aDrawer, Pnts, !isPrimArrayEnabled);
|
CurvePresentation::Add(aPresentation, C, aDeflection, aDrawer, Pnts, Standard_False);
|
||||||
FreeCurves.Append(Pnts);
|
FreeCurves.Append(Pnts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -629,23 +480,12 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!isPrimArrayEnabled)
|
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEB_MESH
|
|
||||||
FreeBoundaryTimer.Stop();
|
|
||||||
UnFreeBoundaryTimer.Start();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (aDrawer->UnFreeBoundaryDraw()) {
|
if (aDrawer->UnFreeBoundaryDraw()) {
|
||||||
|
|
||||||
// Unfree boundaries;
|
// Unfree boundaries;
|
||||||
|
|
||||||
if(!isPrimArrayEnabled) {
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->UnFreeBoundaryAspect()->Aspect());
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
}
|
|
||||||
for (It.Initialize(LUnFree); It.More(); It.Next()) {
|
for (It.Initialize(LUnFree); It.More(); It.Next()) {
|
||||||
const TopoDS_Edge& E = TopoDS::Edge(It.Value());
|
const TopoDS_Edge& E = TopoDS::Edge(It.Value());
|
||||||
try
|
try
|
||||||
@ -655,7 +495,7 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
if (!AddPolygon(E, TheGroup, aDeflection, aDrawer, Pnts)) {
|
if (!AddPolygon(E, TheGroup, aDeflection, aDrawer, Pnts)) {
|
||||||
if (BRep_Tool::IsGeometric(E)) {
|
if (BRep_Tool::IsGeometric(E)) {
|
||||||
BRepAdaptor_Curve C(E);
|
BRepAdaptor_Curve C(E);
|
||||||
CurvePresentation::Add(aPresentation, C, aDeflection, aDrawer, Pnts, !isPrimArrayEnabled);
|
CurvePresentation::Add(aPresentation, C, aDeflection, aDrawer, Pnts, Standard_False);
|
||||||
UnFreeCurves.Append(Pnts);
|
UnFreeCurves.Append(Pnts);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -669,113 +509,77 @@ void Prs3d_WFShape::Add(const Handle (Prs3d_Presentation)& aPresentation,
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!isPrimArrayEnabled)
|
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isPrimArrayEnabled) {
|
if(WireCurves.Size() > 0) {
|
||||||
if(WireCurves.Size() > 0) {
|
nbBounds = WireCurves.Size();
|
||||||
nbBounds = WireCurves.Size();
|
Prs3d_NListIteratorOfListOfSequenceOfPnt It;
|
||||||
Prs3d_NListIteratorOfListOfSequenceOfPnt It;
|
for( It.Init(WireCurves); It.More(); It.Next())
|
||||||
for( It.Init(WireCurves); It.More(); It.Next())
|
nbVertices += It.Value().Length();
|
||||||
nbVertices += It.Value().Length();
|
Handle(Graphic3d_ArrayOfPolylines) WireArray =
|
||||||
Handle(Graphic3d_ArrayOfPolylines) WireArray =
|
new Graphic3d_ArrayOfPolylines(nbVertices,nbBounds);
|
||||||
new Graphic3d_ArrayOfPolylines(nbVertices,nbBounds);
|
for( It.Init(WireCurves); It.More(); It.Next()) {
|
||||||
for( It.Init(WireCurves); It.More(); It.Next()) {
|
TColgp_SequenceOfPnt Pnts;
|
||||||
TColgp_SequenceOfPnt Pnts;
|
Pnts.Assign(It.Value());
|
||||||
Pnts.Assign(It.Value());
|
WireArray->AddBound(Pnts.Length());
|
||||||
WireArray->AddBound(Pnts.Length());
|
for(i=1; i<=Pnts.Length(); i++)
|
||||||
for(i=1; i<=Pnts.Length(); i++)
|
WireArray->AddVertex(Pnts.Value(i));
|
||||||
WireArray->AddVertex(Pnts.Value(i));
|
|
||||||
}
|
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->WireAspect()->Aspect());
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
TheGroup->AddPrimitiveArray(WireArray);
|
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
|
||||||
if(FreeCurves.Size() > 0) {
|
|
||||||
nbBounds = FreeCurves.Size();
|
|
||||||
Prs3d_NListIteratorOfListOfSequenceOfPnt It;
|
|
||||||
for( It.Init(FreeCurves); It.More(); It.Next())
|
|
||||||
nbVertices += It.Value().Length();
|
|
||||||
Handle(Graphic3d_ArrayOfPolylines) FreeArray =
|
|
||||||
new Graphic3d_ArrayOfPolylines(nbVertices,nbBounds);
|
|
||||||
for( It.Init(FreeCurves); It.More(); It.Next()) {
|
|
||||||
TColgp_SequenceOfPnt Pnts;
|
|
||||||
Pnts.Assign(It.Value());
|
|
||||||
FreeArray->AddBound(Pnts.Length());
|
|
||||||
for(i=1; i<=Pnts.Length(); i++)
|
|
||||||
FreeArray->AddVertex(Pnts.Value(i));
|
|
||||||
}
|
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->FreeBoundaryAspect()->Aspect());
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
TheGroup->AddPrimitiveArray(FreeArray);
|
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
|
||||||
if(UnFreeCurves.Size() > 0) {
|
|
||||||
nbBounds = UnFreeCurves.Size();
|
|
||||||
Prs3d_NListIteratorOfListOfSequenceOfPnt It;
|
|
||||||
for( It.Init(UnFreeCurves); It.More(); It.Next())
|
|
||||||
nbVertices += It.Value().Length();
|
|
||||||
Handle(Graphic3d_ArrayOfPolylines) UnFreeArray =
|
|
||||||
new Graphic3d_ArrayOfPolylines(nbVertices,nbBounds);
|
|
||||||
for( It.Init(UnFreeCurves); It.More(); It.Next()) {
|
|
||||||
TColgp_SequenceOfPnt Pnts;
|
|
||||||
Pnts.Assign(It.Value());
|
|
||||||
UnFreeArray->AddBound(Pnts.Length());
|
|
||||||
for(i=1; i<=Pnts.Length(); i++)
|
|
||||||
UnFreeArray->AddVertex(Pnts.Value(i));
|
|
||||||
}
|
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->UnFreeBoundaryAspect()->Aspect());
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
TheGroup->AddPrimitiveArray(UnFreeArray);
|
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
TheGroup->SetPrimitivesAspect(aDrawer->WireAspect()->Aspect());
|
||||||
|
TheGroup->AddPrimitiveArray(WireArray);
|
||||||
}
|
}
|
||||||
|
if(FreeCurves.Size() > 0) {
|
||||||
|
nbBounds = FreeCurves.Size();
|
||||||
|
Prs3d_NListIteratorOfListOfSequenceOfPnt It;
|
||||||
|
for( It.Init(FreeCurves); It.More(); It.Next())
|
||||||
|
nbVertices += It.Value().Length();
|
||||||
|
Handle(Graphic3d_ArrayOfPolylines) FreeArray =
|
||||||
|
new Graphic3d_ArrayOfPolylines(nbVertices,nbBounds);
|
||||||
|
for( It.Init(FreeCurves); It.More(); It.Next()) {
|
||||||
|
TColgp_SequenceOfPnt Pnts;
|
||||||
|
Pnts.Assign(It.Value());
|
||||||
|
FreeArray->AddBound(Pnts.Length());
|
||||||
|
for(i=1; i<=Pnts.Length(); i++)
|
||||||
|
FreeArray->AddVertex(Pnts.Value(i));
|
||||||
|
}
|
||||||
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
TheGroup->SetPrimitivesAspect(aDrawer->FreeBoundaryAspect()->Aspect());
|
||||||
|
TheGroup->AddPrimitiveArray(FreeArray);
|
||||||
|
}
|
||||||
|
if(UnFreeCurves.Size() > 0) {
|
||||||
|
nbBounds = UnFreeCurves.Size();
|
||||||
|
Prs3d_NListIteratorOfListOfSequenceOfPnt It;
|
||||||
|
for( It.Init(UnFreeCurves); It.More(); It.Next())
|
||||||
|
nbVertices += It.Value().Length();
|
||||||
|
Handle(Graphic3d_ArrayOfPolylines) UnFreeArray =
|
||||||
|
new Graphic3d_ArrayOfPolylines(nbVertices,nbBounds);
|
||||||
|
for( It.Init(UnFreeCurves); It.More(); It.Next()) {
|
||||||
|
TColgp_SequenceOfPnt Pnts;
|
||||||
|
Pnts.Assign(It.Value());
|
||||||
|
UnFreeArray->AddBound(Pnts.Length());
|
||||||
|
for(i=1; i<=Pnts.Length(); i++)
|
||||||
|
UnFreeArray->AddVertex(Pnts.Value(i));
|
||||||
|
}
|
||||||
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
||||||
|
TheGroup->SetPrimitivesAspect(aDrawer->UnFreeBoundaryAspect()->Aspect());
|
||||||
|
TheGroup->AddPrimitiveArray(UnFreeArray);
|
||||||
|
}
|
||||||
|
|
||||||
// Points
|
// Points
|
||||||
Standard_Boolean theFirst = Standard_True;
|
for(Tool.InitVertex();Tool.MoreVertex();Tool.NextVertex())
|
||||||
for(Tool.InitVertex();Tool.MoreVertex();Tool.NextVertex()){
|
ShapePoints.Append(BRep_Tool::Pnt(Tool.GetVertex()));
|
||||||
if(theFirst){
|
|
||||||
theFirst = Standard_False;
|
|
||||||
if(!isPrimArrayEnabled) {
|
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->PointAspect()->Aspect());
|
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
TopoDS_Vertex V = Tool.GetVertex();
|
|
||||||
if(!isPrimArrayEnabled)
|
|
||||||
PointPresentation::Add(aPresentation,V);
|
|
||||||
ShapePoints.Append(BRep_Tool::Pnt(V));
|
|
||||||
}
|
|
||||||
if (!theFirst) TheGroup->EndPrimitives();
|
|
||||||
|
|
||||||
nbVertices = ShapePoints.Length();
|
nbVertices = ShapePoints.Length();
|
||||||
if(isPrimArrayEnabled && nbVertices > 0) {
|
if(nbVertices > 0) {
|
||||||
Graphic3d_Array1OfVertex PointArray(1, nbVertices);
|
Graphic3d_Array1OfVertex PointArray(1, nbVertices);
|
||||||
for(i=1; i<=nbVertices; i++)
|
for(i=1; i<=nbVertices; i++)
|
||||||
PointArray.SetValue(i, Graphic3d_Vertex(ShapePoints.Value(i).X(), ShapePoints.Value(i).Y(), ShapePoints.Value(i).Z()));
|
PointArray.SetValue(i, Graphic3d_Vertex(ShapePoints.Value(i).X(), ShapePoints.Value(i).Y(), ShapePoints.Value(i).Z()));
|
||||||
|
|
||||||
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
Handle(Graphic3d_Group) TheGroup = Prs3d_Root::NewGroup(aPresentation);
|
||||||
TheGroup->SetPrimitivesAspect(aDrawer->PointAspect()->Aspect());
|
TheGroup->SetPrimitivesAspect(aDrawer->PointAspect()->Aspect());
|
||||||
TheGroup->BeginPrimitives();
|
|
||||||
TheGroup->MarkerSet(PointArray);
|
TheGroup->MarkerSet(PointArray);
|
||||||
TheGroup->EndPrimitives();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEB_MESH
|
|
||||||
UnFreeBoundaryTimer.Stop();
|
|
||||||
// cout << "Restrictions Min Max computation " ;
|
|
||||||
// RestrictedFaceTimer1.Show();
|
|
||||||
// cout << "Iso loading " ;
|
|
||||||
// RestrictedFaceTimer2.Show();
|
|
||||||
// cout << "Iso hatching " ;
|
|
||||||
// RestrictedFaceTimer3.Show();
|
|
||||||
// cout << "Iso drawing " ;
|
|
||||||
// RestrictedFaceTimer4.Show();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user