1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0023959: Getting rid of generic classes in Visualization: generic classes were removed from Prs3d

Errors corrections; DsgPrs_DatumTool class was removed as unused
This commit is contained in:
aba
2013-06-20 15:28:40 +04:00
parent 8ba3c5e073
commit d7223c763e
48 changed files with 1874 additions and 3239 deletions

View File

@@ -77,15 +77,13 @@ AS_FIRSTAR_LASTPT,AS_FIRSTPT_LASTAR;
class OffsetPresentation;
class DatumTool;
class DatumPrs instantiates Datum from Prs3d(Ax2 from gp,
DatumTool from DsgPrs);
class XYZAxisPresentation;
class XYZPlanePresentation;
class ShadedPlanePresentation;
imported DatumPrs;
ComputeSymbol(aPresentation: Presentation from Prs3d;
anAspect: AngleAspect from Prs3d;
@@ -183,13 +181,13 @@ AS_FIRSTAR_LASTPT,AS_FIRSTPT_LASTAR;
-- special case flag SpecCase equal Standard_True if
-- radius of fillet circle = 0 or if anngle between
-- Vec1(Center, FirstPoint) and Vec2(Center,SecondPoint) equal 0 or PI
DistanceFromApex( elips : Elips from gp;
Apex : Pnt from gp;
par : Real from Standard)
returns Real from Standard;
---Purpose: computes length of ellipse arc in parametric units
---Purpose: computes length of ellipse arc in parametric units
end DsgPrs;

View File

@@ -0,0 +1,103 @@
// Copyright (c) 2013 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 <DsgPrs_DatumPrs.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
#include <gp_Ax2.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_ArrayOfSegments.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_DatumAspect.hxx>
#include <Prs3d_TextAspect.hxx>
#include <Prs3d_ArrowAspect.hxx>
void DsgPrs_DatumPrs::Add (const Handle(Prs3d_Presentation)& thePresentation,
const gp_Ax2& theDatum,
const Handle(Prs3d_Drawer)& theDrawer)
{
Handle(Prs3d_DatumAspect) aDatumAspect = theDrawer->DatumAspect();
Handle(Graphic3d_Group) aGroup = Prs3d_Root::CurrentGroup(thePresentation);
Quantity_Color aColor;
Aspect_TypeOfLine aTypeOfLine;
Standard_Real aWidth;
aDatumAspect->FirstAxisAspect()->Aspect()->Values(aColor, aTypeOfLine, aWidth);
gp_Ax2 anAxis(theDatum);
gp_Pnt anOrigin = anAxis.Location();
gp_Dir aXDir = anAxis.XDirection();
gp_Dir aYDir = anAxis.YDirection();
gp_Dir aZDir = anAxis.Direction();
Quantity_Length anAxisLength;
Quantity_Length anArrowAngle = theDrawer->ArrowAspect()->Angle();
Handle(Graphic3d_ArrayOfSegments) aPrims;
if (aDatumAspect->DrawFirstAndSecondAxis())
{
anAxisLength = aDatumAspect->FirstAxisLength();
const gp_Pnt aPoint1(anOrigin.XYZ() + aXDir.XYZ()*anAxisLength);
aGroup->SetPrimitivesAspect(aDatumAspect->FirstAxisAspect()->Aspect());
aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(anOrigin);
aPrims->AddVertex(aPoint1);
aGroup->AddPrimitiveArray(aPrims);
aGroup->SetPrimitivesAspect(theDrawer->ArrowAspect()->Aspect());
Prs3d_Arrow::Draw(thePresentation,aPoint1,aXDir,anArrowAngle,anAxisLength/10.);
aGroup->SetPrimitivesAspect(theDrawer->TextAspect()->Aspect());
Graphic3d_Vertex aVertex1(aPoint1.X(),aPoint1.Y(),aPoint1.Z());
aGroup->Text(Standard_CString("X"), aVertex1,16.);
anAxisLength = aDatumAspect->SecondAxisLength();
const gp_Pnt aPoint2(anOrigin.XYZ() + aYDir.XYZ()*anAxisLength);
aGroup->SetPrimitivesAspect(aDatumAspect->SecondAxisAspect()->Aspect());
aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(anOrigin);
aPrims->AddVertex(aPoint2);
aGroup->AddPrimitiveArray(aPrims);
aGroup->SetPrimitivesAspect(theDrawer->ArrowAspect()->Aspect());
Prs3d_Arrow::Draw(thePresentation,aPoint2,aYDir,anArrowAngle,anAxisLength/10.);
aGroup->SetPrimitivesAspect(theDrawer->TextAspect()->Aspect());
Graphic3d_Vertex aVertex2(aPoint2.X(),aPoint2.Y(),aPoint2.Z());
aGroup->Text(Standard_CString("Y"), aVertex2,16.);
}
if (aDatumAspect->DrawThirdAxis())
{
anAxisLength = aDatumAspect->ThirdAxisLength();
const gp_Pnt aPoint3(anOrigin.XYZ() + aZDir.XYZ()*anAxisLength);
aGroup->SetPrimitivesAspect(aDatumAspect->ThirdAxisAspect()->Aspect());
aPrims = new Graphic3d_ArrayOfSegments(2);
aPrims->AddVertex(anOrigin);
aPrims->AddVertex(aPoint3);
aGroup->AddPrimitiveArray(aPrims);
aGroup->SetPrimitivesAspect(theDrawer->ArrowAspect()->Aspect());
Prs3d_Arrow::Draw(thePresentation,aPoint3,aZDir,anArrowAngle,anAxisLength/10.);
aGroup->SetPrimitivesAspect(theDrawer->TextAspect()->Aspect());
Graphic3d_Vertex aVertex3(aPoint3.X(),aPoint3.Y(),aPoint3.Z());
aGroup->Text(Standard_CString("Z"), aVertex3,16.);
}
}

View File

@@ -1,7 +1,4 @@
// Created on: 1994-10-10
// Created by: Arnaud BOUZY
// Copyright (c) 1994-1999 Matra Datavision
// Copyright (c) 1999-2012 OPEN CASCADE SAS
// Copyright (c) 2013 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
@@ -17,12 +14,24 @@
// 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 _DsgPrs_DatumPrs_H__
#define _DsgPrs_DatumPrs_H__
#include <gp_Ax2.hxx>
#include <Prs3d_Drawer.hxx>
#include <Prs3d_Presentation.hxx>
#include <Prs3d_Root.hxx>
#include <DsgPrs_DatumTool.ixx>
gp_Ax2 DsgPrs_DatumTool::Ax2(const gp_Ax2& ax)
class DsgPrs_DatumPrs : public Prs3d_Root
{
return ax;
}
public:
DEFINE_STANDARD_ALLOC
Standard_EXPORT static void Add
(const Handle(Prs3d_Presentation)& thePresentation,
const gp_Ax2& theDatum,
const Handle(Prs3d_Drawer)& theDrawer);
};
#endif

View File

@@ -1,32 +0,0 @@
-- Created on: 1994-10-10
-- Created by: Arnaud BOUZY
-- Copyright (c) 1994-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 DatumTool from DsgPrs
---Purpose: A generic framework for defining display of datums. Instantiates Prs3d_Datum.
uses Ax2 from gp
is
Ax2 ( myclass; aDatum: Ax2 from gp ) returns Ax2 from gp;
end DatumTool from DsgPrs;

2
src/DsgPrs/FILES Normal file
View File

@@ -0,0 +1,2 @@
DsgPrs_DatumPrs.hxx
DsgPrs_DatumPrs.cxx