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

0024133: Development of improvement of dimensions implementation; new length, radius,diameter and angle dimensions.

Some corrections; test cases were added; coding standards in MFC samples & presentations
Request stencil buffer for Linux.
correct test cases; correct compilation errors
compilation warnings (gcc/Linux)
This commit is contained in:
aba
2013-10-31 16:49:38 +04:00
committed by bugmaster
parent 7c633a3eab
commit a6eb515f9d
137 changed files with 7591 additions and 6616 deletions

View File

@@ -74,6 +74,19 @@ is
-- TOH_NotSet is used by AIS_Drawer class, it means that the drawer should return the global value.
-- For more details see AIS_Drawer class, AIS_Shape::Compute() method and
-- HLRAlgo package from TKHLR toolkit.
enumeration HorizontalTextAlignment is HTA_Left, HTA_Right, HTA_Center;
---Purpose: To declare horisontal alignment for dimension text.
enumeration VerticalTextAlignment is VTA_Top, VTA_Bottom, VTA_Center;
---Purpose: To declare vertical alignment for dimension text label.
enumeration DimensionArrowOrientation is DAO_Internal, DAO_External;
---Purpose: To declare arrow orientation for dimenation.
-- External orientation means that dimension has extension parts outside the measured area.
--Internal orientation means the dimension arrows are in the measured area, and no extension parts are needed.
class Presentation;
---Purpose: defines the presentation object. This object can be
@@ -92,13 +105,10 @@ is
class LineAspect;
class ShadingAspect;
class TextAspect;
deferred class CompositeAspect;
class IsoAspect;
class ArrowAspect;
class PlaneAspect;
class ArrowAspect;
class LengthAspect;
class AngleAspect;
class RadiusAspect;
class DimensionAspect;
class DatumAspect;
class Drawer;
@@ -123,10 +133,6 @@ is
---Category: Basis construction elements.
class LengthPresentation;
class AnglePresentation;
class Text;
---Category: Class signatures.

View File

@@ -1,74 +0,0 @@
-- Created on: 1993-06-03
-- Created by: Jean-Louis FRENKEL
-- Copyright (c) 1993-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 AngleAspect from Prs3d inherits CompositeAspect from Prs3d
---Purpose: A framework for defining how an angle will be
-- displayed in a presentation. Aspects of angle display include:
-- - display of the arrow pointing to the angle
-- - display of the line making up the shaft of the arrow
-- - display of the text referring to the angle.
-- The definition set by this class is then passed to the
-- attribute manager Prs3d_Drawer.
-- Any object which requires a value for angle aspect as
-- an argument may then be given the attribute manager
-- as a substitute argument in the form of a field such as
-- myDrawer for example.
uses
LineAspect from Prs3d,
TextAspect from Prs3d,
ArrowAspect from Prs3d
is
--
-- Attributes for the lines.
--
Create returns mutable AngleAspect from Prs3d;
LineAspect(me) returns mutable LineAspect from Prs3d;
--- Purpose: Returns the setting determining how the line making
-- up the shaft of the arrow will be displayed.
SetLineAspect(me: mutable; anAspect: LineAspect from Prs3d);
---Purpose: Sets how the line making up the shaft of an arrow will be displayed.
TextAspect(me) returns mutable TextAspect from Prs3d is static;
--- Purpose: Returns the setting determining how text in the
-- presentation of an angle will be displayed.
SetTextAspect(me:mutable; anAspect: TextAspect from Prs3d) is static;
---Purpose: Sets how text in the presentation of an angle will be displayed.
ArrowAspect(me) returns mutable ArrowAspect from Prs3d is static;
---Purpose: Returns the setting determining how an arrow head
-- which points to an angle will be displayed.
SetArrowAspect(me: mutable; anAspect: ArrowAspect from Prs3d) is static;
---Purpose: Sets how an arrow head which points to an angle will be displayed.
fields
myLineAspect: LineAspect from Prs3d;
myArrowAspect: ArrowAspect from Prs3d;
myTextAspect: TextAspect from Prs3d;
end AngleAspect from Prs3d;

View File

@@ -1,48 +0,0 @@
// Copyright (c) 1995-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.
#include <Prs3d_AngleAspect.ixx>
Prs3d_AngleAspect::Prs3d_AngleAspect() {
myLineAspect = new Prs3d_LineAspect
(Quantity_NOC_LAWNGREEN,Aspect_TOL_SOLID,1.);
myArrowAspect = new Prs3d_ArrowAspect;
myTextAspect = new Prs3d_TextAspect;
}
Handle (Prs3d_LineAspect) Prs3d_AngleAspect::LineAspect () const {
return myLineAspect;}
void Prs3d_AngleAspect::SetLineAspect(const Handle(Prs3d_LineAspect)& anAspect) {
myLineAspect = anAspect;}
Handle(Prs3d_ArrowAspect) Prs3d_AngleAspect::ArrowAspect () const {
return myArrowAspect;}
void Prs3d_AngleAspect::SetArrowAspect (
const Handle(Prs3d_ArrowAspect)& anAspect) {
myArrowAspect = anAspect;
}
Handle(Prs3d_TextAspect) Prs3d_AngleAspect::TextAspect () const {
return myTextAspect;}
void Prs3d_AngleAspect::SetTextAspect (
const Handle(Prs3d_TextAspect)& anAspect) {
myTextAspect = anAspect;
}

View File

@@ -1,48 +0,0 @@
-- Created on: 1994-02-22
-- Created by: Jean Louis FRENKEL
-- 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 AnglePresentation from Prs3d inherits Root from Prs3d
---Purpose: A framework to define the display of angles.
uses
Presentation from Prs3d,
Pnt from gp,
Drawer from Prs3d,
ExtendedString from TCollection
is
Draw( myclass; aPresentation: Presentation from Prs3d;
aDrawer: Drawer from Prs3d;
aText: ExtendedString from TCollection;
AttachmentPoint1: Pnt from gp;
AttachmentPoint2: Pnt from gp;
AttachmentPoint3: Pnt from gp;
OffsetPoint: Pnt from gp);
---Purpose: Defines the representation of the angle between the
-- line defined by the points AttachmentPoint1 and
-- AttachmentPoint2 and the line defined by the points
-- AttachmentPoint1 and AttachmentPoint3.
-- The text aText is displayed at the point OffsetPoint,
-- and the drawer aDrawer specifies the display
-- attributes which angles will have.
-- The presentation object aPresentation stores the
-- information defined in this framework.
end AnglePresentation from Prs3d;

View File

@@ -1,80 +0,0 @@
// Copyright (c) 1995-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.
#include <Prs3d_AnglePresentation.ixx>
#include <gp_Lin.hxx>
#include <gp_Dir.hxx>
#include <ElCLib.hxx>
#include <Graphic3d_Group.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_AngleAspect.hxx>
#include <TCollection_AsciiString.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Prs3d_Text.hxx>
void Prs3d_AnglePresentation::Draw (
const Handle(Prs3d_Presentation)& aPresentation,
const Handle(Prs3d_Drawer)& aDrawer,
const TCollection_ExtendedString& aText,
const gp_Pnt& AttachmentPoint1,
const gp_Pnt& AttachmentPoint2,
const gp_Pnt& AttachmentPoint3,
const gp_Pnt& OffsetPoint)
{
Handle(Prs3d_AngleAspect) AA = aDrawer->AngleAspect();
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(AA->LineAspect()->Aspect());
gp_Vec V1 (AttachmentPoint1,AttachmentPoint2);
gp_Vec V2 (AttachmentPoint1,AttachmentPoint3);
const Standard_Real alpha = V1.Angle(V2);
const Standard_Real ray = AttachmentPoint1.Distance(OffsetPoint);
gp_Dir I (V1);
gp_Dir K = I.Crossed(gp_Dir(V2));
gp_Dir J = K.Crossed(I);
const Standard_Integer nbp = Max (4 , Standard_Integer (50. * alpha / M_PI));
const Standard_Real dteta = alpha/(nbp-1);
gp_Vec u;
gp_Pnt p1, p2;
Handle(Graphic3d_ArrayOfPolylines) aPrims = new Graphic3d_ArrayOfPolylines(nbp+2);
aPrims->AddVertex(AttachmentPoint2);
for (Standard_Integer i = 1; i<=nbp; i++)
{
u = (gp_Vec(I) * Cos ( (i-1) * dteta)
+ gp_Vec(J) * Sin ( (i-1) * dteta)) * ray ;
p2 = AttachmentPoint1.Translated(u);
aPrims->AddVertex(p2);
if( i == nbp ) {
gp_Dir dir( gp_Vec(p1,p2) );
Prs3d_Arrow::Draw(aPresentation,p2,dir,AA->ArrowAspect()->Angle(),AA->ArrowAspect()->Length());
}
p1 = p2;
}
aPrims->AddVertex(AttachmentPoint3);
Prs3d_Root::CurrentGroup(aPresentation)->AddPrimitiveArray(aPrims);
u = (gp_Vec(I) * Cos (0.5*alpha)
+ gp_Vec(J) * Sin (0.5*alpha)) * ray ;
Prs3d_Text::Draw(aPresentation,AA->TextAspect(),aText,AttachmentPoint1.Translated(u));
}

View File

@@ -21,7 +21,7 @@
-- Modified GG : GER61351 01/02/00 Add SetColor() & Aspect() methods
class ArrowAspect from Prs3d inherits CompositeAspect from Prs3d
class ArrowAspect from Prs3d inherits BasicAspect from Prs3d
---Purpose: A framework for displaying arrows in representations
-- of dimensions and relations.
uses

View File

@@ -1,28 +0,0 @@
-- Created on: 2000-02-15
-- Created by: Gerard GRAS
-- Copyright (c) 2000-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.
---Purpose All composite Prs3d_xxxAspect must inherits from this class
deferred class CompositeAspect from Prs3d inherits TShared from MMgt
is
end CompositeAspect from Prs3d;

View File

@@ -1,18 +0,0 @@
// 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.
#include <Prs3d_CompositeAspect.ixx>

View File

@@ -20,7 +20,7 @@
class DatumAspect from Prs3d inherits CompositeAspect from Prs3d
class DatumAspect from Prs3d inherits BasicAspect from Prs3d
---Purpose: A framework to define the display of datums.
uses

View File

@@ -0,0 +1,118 @@
-- Copyright (c) 1993-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 DimensionAspect from Prs3d inherits BasicAspect from Prs3d
---Purpose: defines the attributes when drawing a Length Presentation.
uses
HorizontalTextAlignment from Prs3d,
VerticalTextAlignment from Prs3d,
DimensionArrowOrientation from Prs3d,
AspectLine3d from Graphic3d,
ArrowAspect from Prs3d,
LineAspect from Prs3d,
TextAspect from Prs3d,
NameOfColor from Quantity,
Color from Quantity,
TypeOfLine from Aspect,
PlaneAngle from Quantity,
TypeOfLine from Aspect
is
Create returns mutable DimensionAspect from Prs3d;
--- Purpose: Constructs an empty framework to define the display of dimensions.
LineAspect(me) returns mutable LineAspect from Prs3d;
---Purpose: Returns the settings for the display of lines used in presentation of dimensions.
SetLineAspect(me: mutable; theAspect: LineAspect from Prs3d);
---Purpose: Sets the display attributes of lines used in presentation of dimensions.
TextAspect(me) returns mutable TextAspect from Prs3d is static;
--- Purpose: Returns the settings for the display of text used in presentation of dimensions.
SetTextAspect(me:mutable; theAspect: TextAspect from Prs3d) is static;
---Purpose: Sets the display attributes of text used in presentation of dimensions.
IsText3d(me) returns Boolean from Standard;
--- Purpose: Check if text for dimension label is 3d.
MakeText3d (me:mutable; isText3d: Boolean from Standard);
---Purpose: Sets type of text.
IsTextShaded (me) returns Boolean from Standard;
--- Purpose: Check if 3d text for dimension label is shaded.
MakeTextShaded (me: mutable; isTextShaded: Boolean from Standard);
--- Purpose: Turns on/off text shading for 3d text.
IsArrows3d(me) returns Boolean from Standard;
--- Purpose: Gets type of arrows.
MakeArrows3d (me:mutable; isArrows3d: Boolean from Standard);
---Purpose: Sets type of arrows.
SetArrowOrientation(me: mutable; theArrowOrient: DimensionArrowOrientation from Prs3d);
--- Purpose: Sets orientation of arrows (external or internal).
-- By default orientation is chosen automatically according to situation and text label size.
GetArrowOrientation (me) returns DimensionArrowOrientation from Prs3d;
--- Purpose: Gets orientation of arrows (external or internal).
SetVerticalTextAlignment(me: mutable; theVertTextAlignment: VerticalTextAlignment from Prs3d);
--- Purpose: Sets vertical text alignment for text label.
VerticalTextAlignment (me) returns VerticalTextAlignment from Prs3d;
--- Purpose: Gets vertical text alignment for text label.
SetHorizontalTextAlignment (me: mutable; theHorTextAlignment: HorizontalTextAlignment from Prs3d);
--- Purpose: Sets horizontal text alignment for text label.
HorizontalTextAlignment (me) returns HorizontalTextAlignment from Prs3d;
--- Purpose: Gets horizontal text alignment for text label.
ArrowAspect(me) returns mutable ArrowAspect from Prs3d is static;
--- Purpose: Returns the settings for displaying arrows.
SetArrowAspect(me: mutable; theAspect: ArrowAspect from Prs3d) is static;
---Purpose: Sets the display attributes of arrows used in presentation of dimensions.
SetCommonColor(me:mutable; theColor: Color from Quantity) is static;
---Purpose: Sets the same color for all parts of dimension: lines, arrows and text.
fields
myLineAspect: LineAspect from Prs3d;
---Purpose: Text style. The size for 3d (or 2d) text is also inside here.
myTextAspect: TextAspect from Prs3d;
myArrowAspect : ArrowAspect from Prs3d;
myIsText3d : Boolean from Standard;
myIsTextShaded : Boolean from Standard;
myIsArrows3d: Boolean from Standard;
myArrowOrientation : DimensionArrowOrientation from Prs3d;
---Purpose: Dimension arrow orientation
-- By default, it is computed automatically. Its value depends on the text
-- bouning rectangle size and distance between two flyouts.
-- By default, it is internal one.
myHorTextAlignment: HorizontalTextAlignment from Prs3d;
---Purpose:Horizontal text alignment (Prs3d_HTA_Left/Prs3d_HTA_Right/Prs3d_HTA_Center).
-- Defines horizontal position of text value label, by default it is center.
myVerTextAlignment: VerticalTextAlignment from Prs3d;
---Purpose: Vertical text alignment (Prs3d_VTA_Top, Prs3d_VTA_Bottom/Prs3d_VTA_Center)
-- Defines vertical position of text value lable, by default it is center.
end DimensionAspect from Prs3d;

View File

@@ -0,0 +1,242 @@
// Copyright (c) 1998-1999 Matra Datavision
// Copyright (c) 1999-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 <Prs3d_DimensionAspect.hxx>
#include <Aspect_TypeOfLine.hxx>
#include <Graphic3d_AspectText3d.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_TextAspect.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Quantity_Color.hxx>
IMPLEMENT_STANDARD_HANDLE (Prs3d_DimensionAspect, Prs3d_BasicAspect)
IMPLEMENT_STANDARD_RTTIEXT (Prs3d_DimensionAspect, Prs3d_BasicAspect)
//=======================================================================
//function : Constructor
//purpose :
//=======================================================================
Prs3d_DimensionAspect::Prs3d_DimensionAspect ()
{
// Text alignment
myHorTextAlignment = Prs3d_HTA_Center;
myVerTextAlignment = Prs3d_VTA_Center;
// Arrow orientation, will be computed on further steps, by default it is internal.
myArrowOrientation = Prs3d_DAO_Internal;
myLineAspect = new Prs3d_LineAspect (Quantity_NOC_LAWNGREEN,Aspect_TOL_SOLID,1.);
myTextAspect = new Prs3d_TextAspect;
myTextAspect->Aspect()->SetTextZoomable (Standard_False);
myTextAspect->SetColor (Quantity_NOC_LAWNGREEN);
myTextAspect->SetHorizontalJustification (Graphic3d_HTA_CENTER);
myTextAspect->SetVerticalJustification (Graphic3d_VTA_CENTER);
myArrowAspect = new Prs3d_ArrowAspect;
myArrowAspect->SetColor (Quantity_NOC_LAWNGREEN);
myArrowAspect->SetLength (6.);
}
//=======================================================================
//function : SetCommonColor
//purpose : Sets the same color for all parts of dimension:
// lines, arrows and text.
//=======================================================================
void Prs3d_DimensionAspect::SetCommonColor (const Quantity_Color& theColor)
{
myLineAspect->SetColor (theColor);
myTextAspect->SetColor (theColor);
myArrowAspect->SetColor (theColor);
}
//=======================================================================
//function : LineAspect
//purpose :
//=======================================================================
Handle(Prs3d_LineAspect) Prs3d_DimensionAspect::LineAspect () const
{
return myLineAspect;
}
//=======================================================================
//function : SetLineAspect
//purpose :
//=======================================================================
void Prs3d_DimensionAspect::SetLineAspect(const Handle(Prs3d_LineAspect)& theAspect)
{
myLineAspect = theAspect;
}
//=======================================================================
//function : TextAspect
//purpose :
//=======================================================================
Handle(Prs3d_TextAspect) Prs3d_DimensionAspect::TextAspect () const
{
return myTextAspect;
}
//=======================================================================
//function : SetTextAspect
//purpose :
//=======================================================================
void Prs3d_DimensionAspect::SetTextAspect (const Handle(Prs3d_TextAspect)& theAspect)
{
myTextAspect = theAspect;
}
//=======================================================================
//function : MakeArrows3D
//purpose :
//=======================================================================
void Prs3d_DimensionAspect::MakeArrows3d (const Standard_Boolean isArrows3d)
{
myIsArrows3d = isArrows3d;
}
//=======================================================================
//function : IsArrows3D
//purpose :
//=======================================================================
Standard_Boolean Prs3d_DimensionAspect::IsArrows3d () const
{
return myIsArrows3d;
}
//=======================================================================
//function : MakeText3D
//purpose :
//=======================================================================
void Prs3d_DimensionAspect::MakeText3d (const Standard_Boolean isText3d)
{
myIsText3d = isText3d;
}
//=======================================================================
//function : IsText3D
//purpose :
//=======================================================================
Standard_Boolean Prs3d_DimensionAspect::IsText3d () const
{
return myIsText3d;
}
//=======================================================================
//function : IsTextShaded
//purpose :
//=======================================================================
Standard_Boolean Prs3d_DimensionAspect::IsTextShaded () const
{
return myIsTextShaded;
}
//=======================================================================
//function : MakeTextShaded
//purpose :
//=======================================================================
void Prs3d_DimensionAspect::MakeTextShaded (const Standard_Boolean isTextShaded)
{
myIsTextShaded = isTextShaded;
}
//=======================================================================
//function : SetArrowOrientation
//purpose :
//=======================================================================
void Prs3d_DimensionAspect::SetArrowOrientation (const Prs3d_DimensionArrowOrientation theArrowOrient)
{
myArrowOrientation = theArrowOrient;
}
//=======================================================================
//function : GetArrowOrientation
//purpose :
//=======================================================================
Prs3d_DimensionArrowOrientation Prs3d_DimensionAspect::GetArrowOrientation () const
{
return myArrowOrientation;
}
//=======================================================================
//function : VerticalTextAlignment
//purpose :
//=======================================================================
Prs3d_VerticalTextAlignment Prs3d_DimensionAspect::VerticalTextAlignment () const
{
return myVerTextAlignment;
}
//=======================================================================
//function : SetVerticalTextAlignment
//purpose :
//=======================================================================
void Prs3d_DimensionAspect::SetVerticalTextAlignment (const Prs3d_VerticalTextAlignment theVertTextAlignment)
{
myVerTextAlignment = theVertTextAlignment;
}
//=======================================================================
//function : HorizontalTextAlignment
//purpose :
//=======================================================================
Prs3d_HorizontalTextAlignment Prs3d_DimensionAspect::HorizontalTextAlignment () const
{
return myHorTextAlignment;
}
//=======================================================================
//function : SetHorizontalTextAlignment
//purpose :
//=======================================================================
void Prs3d_DimensionAspect::SetHorizontalTextAlignment (const Prs3d_HorizontalTextAlignment theHorTextAlignment)
{
myHorTextAlignment = theHorTextAlignment;
}
//=======================================================================
//function : ArrowAspect
//purpose :
//=======================================================================
Handle(Prs3d_ArrowAspect) Prs3d_DimensionAspect::ArrowAspect () const
{
return myArrowAspect;
}
//=======================================================================
//function : SetArrowAspect
//purpose :
//=======================================================================
void Prs3d_DimensionAspect::SetArrowAspect (const Handle(Prs3d_ArrowAspect)& theAspect)
{
myArrowAspect = theAspect;
}

View File

@@ -39,10 +39,8 @@ uses
PointAspect from Prs3d,
ShadingAspect from Prs3d,
IsoAspect from Prs3d,
LengthAspect from Prs3d,
AngleAspect from Prs3d,
DimensionAspect from Prs3d,
PlaneAspect from Prs3d,
RadiusAspect from Prs3d,
ArrowAspect from Prs3d,
TypeOfDeflection from Aspect,
NameOfColor from Quantity,
@@ -474,30 +472,13 @@ is
is virtual;
---Purpose: Sets the modality anAspect for the display of datums.
LengthAspect(me:mutable) returns mutable LengthAspect from Prs3d
---Purpose: Returns settings for the appearance of lengths.
DimensionAspect(me:mutable) returns mutable DimensionAspect from Prs3d
---Purpose: Returns settings for the appearance of dimensions.
is virtual;
SetLengthAspect(me:mutable; anAspect: LengthAspect from Prs3d)
SetDimensionAspect(me:mutable; theAspect: DimensionAspect from Prs3d)
is virtual;
---Purpose: Sets the modality anAspect for display of lengths.
AngleAspect(me:mutable) returns mutable AngleAspect from Prs3d
---Purpose: Returns settings for lines used to display angles.
is virtual;
SetAngleAspect(me:mutable; anAspect: AngleAspect from Prs3d)
is virtual;
---Purpose: Sets the modality anAspect for the display of angles.
RadiusAspect(me) returns mutable RadiusAspect from Prs3d
---Purpose: Returns settings for lines which serve to display radii.
is virtual;
SetRadiusAspect(me:mutable; anAspect: RadiusAspect from Prs3d)
is virtual;
--- Purpose: Sets the parameter anAspect for display attributes of radii.
---Purpose: Sets the modality anAspect for display of dimensions.
SectionAspect (me:mutable) returns mutable LineAspect from Prs3d
---Purpose: The LineAspect for the wire can be edited.
@@ -568,9 +549,7 @@ fields
myVectorAspect: LineAspect from Prs3d is protected;
myDatumAspect: DatumAspect from Prs3d is protected;
myDatumScale: Real from Standard is protected;
myLengthAspect: LengthAspect from Prs3d is protected;
myAngleAspect: AngleAspect from Prs3d is protected;
myRadiusAspect: RadiusAspect from Prs3d is protected;
myDimensionAspect: DimensionAspect from Prs3d is protected;
mySectionAspect: LineAspect from Prs3d is protected;
myFaceBoundaryDraw : Boolean from Standard is protected;
myFaceBoundaryAspect : LineAspect from Prs3d is protected;

View File

@@ -397,38 +397,20 @@ void Prs3d_Drawer::SetPlaneAspect ( const Handle(Prs3d_PlaneAspect)& anAspect) {
myPlaneAspect = anAspect;
}
Handle (Prs3d_LengthAspect) Prs3d_Drawer::LengthAspect () {
if (myLengthAspect.IsNull())
myLengthAspect = new Prs3d_LengthAspect;
Handle (Prs3d_DimensionAspect) Prs3d_Drawer::DimensionAspect ()
{
if (myDimensionAspect.IsNull())
myDimensionAspect = new Prs3d_DimensionAspect;
return myLengthAspect;
return myDimensionAspect;
}
void Prs3d_Drawer::SetLengthAspect ( const Handle(Prs3d_LengthAspect)& anAspect) {
myLengthAspect = anAspect;
void Prs3d_Drawer::SetDimensionAspect ( const Handle(Prs3d_DimensionAspect)& theAspect)
{
myDimensionAspect = theAspect;
}
Handle (Prs3d_AngleAspect) Prs3d_Drawer::AngleAspect () {
if (myAngleAspect.IsNull())
myAngleAspect = new Prs3d_AngleAspect;
return myAngleAspect;
}
void Prs3d_Drawer::SetAngleAspect ( const Handle(Prs3d_AngleAspect)& anAspect) {
myAngleAspect = anAspect;
}
Handle (Prs3d_RadiusAspect) Prs3d_Drawer::RadiusAspect () const {
return myRadiusAspect;
}
void Prs3d_Drawer::SetRadiusAspect ( const Handle(Prs3d_RadiusAspect)& anAspect) {
myRadiusAspect = anAspect;
}
Handle (Prs3d_LineAspect) Prs3d_Drawer::SectionAspect () {
if (mySectionAspect.IsNull())
mySectionAspect = new Prs3d_LineAspect

View File

@@ -1,87 +0,0 @@
-- Created on: 1993-06-03
-- Created by: Jean-Louis FRENKEL
-- Copyright (c) 1993-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 LengthAspect from Prs3d inherits CompositeAspect from Prs3d
---Purpose: defines the attributes when drawing a Length Presentation.
uses
AspectLine3d from Graphic3d,
ArrowAspect from Prs3d,
LineAspect from Prs3d,
TextAspect from Prs3d,
NameOfColor from Quantity,
TypeOfLine from Aspect,
PlaneAngle from Quantity
is
--
-- Attributes for the lines.
--
Create returns mutable LengthAspect from Prs3d;
--- Purpose: Constructs an empty framework to define the display of lengths.
LineAspect(me) returns mutable LineAspect from Prs3d;
---Purpose: Returns the settings for the display of lines used in presentation of lengths.
SetLineAspect(me: mutable; anAspect: LineAspect from Prs3d);
---Purpose: Sets the display attributes of lines used in presentation of lengths.
Arrow1Aspect(me) returns mutable ArrowAspect from Prs3d is static;
--- Purpose: Returns the settings for displaying a right-pointing arrow.
SetArrow1Aspect(me: mutable; anAspect: ArrowAspect from Prs3d) is static;
---Purpose: Sets the display attributes of the first arrow used in presentation of lengths.
Arrow2Aspect(me) returns mutable ArrowAspect from Prs3d is static;
--- Purpose: Returns the settings for displaying a left-pointing arrow.
SetArrow2Aspect(me: mutable ; anAspect: ArrowAspect from Prs3d) is static;
---Purpose: Sets the display attributes of the second arrow used in presentation of lengths.
TextAspect(me) returns mutable TextAspect from Prs3d is static;
--- Purpose: Returns the settings for the display of text used in presentation of lengths.
SetTextAspect(me:mutable; anAspect: TextAspect from Prs3d) is static;
---Purpose: Sets the display attributes of text used in presentation of lengths.
SetDrawFirstArrow(me: mutable; draw: Boolean from Standard) is static;
--- Purpose: Sets the DrawFirstArrow attributes to active.
DrawFirstArrow(me) returns Boolean from Standard is static;
---Purpose: Returns true if the first arrow can be drawn.
SetDrawSecondArrow(me: mutable; draw: Boolean from Standard) is static;
---Purpose: Sets the DrawSecondArrow attributes to active.
DrawSecondArrow(me) returns Boolean from Standard is static;
---Purpose: Returns true if the second arrow can be drawn.
fields
myLineAspect: LineAspect from Prs3d;
myArrow1Aspect: ArrowAspect from Prs3d;
myArrow2Aspect: ArrowAspect from Prs3d;
myTextAspect: TextAspect from Prs3d;
myDrawFirstArrow: Boolean from Standard;
myDrawSecondArrow: Boolean from Standard;
end LengthAspect from Prs3d;

View File

@@ -1,71 +0,0 @@
// Copyright (c) 1995-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.
#include <Prs3d_LengthAspect.ixx>
Prs3d_LengthAspect::Prs3d_LengthAspect() {
myLineAspect = new Prs3d_LineAspect
(Quantity_NOC_LAWNGREEN,Aspect_TOL_SOLID,1.);
myArrow1Aspect = new Prs3d_ArrowAspect;
myArrow2Aspect = new Prs3d_ArrowAspect;
myTextAspect = new Prs3d_TextAspect;
myDrawFirstArrow = Standard_True;
myDrawSecondArrow = Standard_True;
}
Handle (Prs3d_LineAspect) Prs3d_LengthAspect::LineAspect () const {
return myLineAspect;}
void Prs3d_LengthAspect::SetLineAspect(const Handle(Prs3d_LineAspect)& anAspect) {
myLineAspect = anAspect;}
Handle(Prs3d_ArrowAspect) Prs3d_LengthAspect::Arrow1Aspect () const {
return myArrow1Aspect;}
void Prs3d_LengthAspect::SetArrow1Aspect (
const Handle(Prs3d_ArrowAspect)& anAspect) {
myArrow1Aspect = anAspect;
}
Handle(Prs3d_ArrowAspect) Prs3d_LengthAspect::Arrow2Aspect () const {
return myArrow2Aspect;}
void Prs3d_LengthAspect::SetArrow2Aspect (
const Handle(Prs3d_ArrowAspect)& anAspect) {
myArrow2Aspect = anAspect;
}
Handle(Prs3d_TextAspect) Prs3d_LengthAspect::TextAspect () const {
return myTextAspect;}
void Prs3d_LengthAspect::SetTextAspect (
const Handle(Prs3d_TextAspect)& anAspect) {
myTextAspect = anAspect;
}
void Prs3d_LengthAspect::SetDrawFirstArrow (const Standard_Boolean draw) {
myDrawFirstArrow = draw;
}
Standard_Boolean Prs3d_LengthAspect::DrawFirstArrow () const {
return myDrawFirstArrow;
}
void Prs3d_LengthAspect::SetDrawSecondArrow (const Standard_Boolean draw) {
myDrawSecondArrow = draw;
}
Standard_Boolean Prs3d_LengthAspect::DrawSecondArrow () const {
return myDrawSecondArrow;
}

View File

@@ -1,46 +0,0 @@
-- Created on: 1993-06-03
-- Created by: Jean-Louis FRENKEL
-- Copyright (c) 1993-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 LengthPresentation from Prs3d inherits Root from Prs3d
---Purpose: A framework to define the display of lengths.
uses
Presentation from Prs3d,
Pnt from gp,
Drawer from Prs3d,
ExtendedString from TCollection
is
Draw( myclass; aPresentation: Presentation from Prs3d;
aDrawer: Drawer from Prs3d;
aText: ExtendedString from TCollection;
AttachmentPoint1: Pnt from gp;
AttachmentPoint2: Pnt from gp;
OffsetPoint: Pnt from gp);
---Purpose: Defines the display of the length between the points
-- AttachmentPoint1 and AttachmentPoint2.
-- The text aText is displayed at the point OffsetPoint,
-- and the drawer aDrawer specifies the display
-- attributes which lengths will have.
-- The presentation object aPresentation stores the
-- information defined in this framework.
end LengthPresentation from Prs3d;

View File

@@ -1,69 +0,0 @@
// Copyright (c) 1995-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.
#include <Prs3d_LengthPresentation.ixx>
#include <gp_Lin.hxx>
#include <gp_Dir.hxx>
#include <ElCLib.hxx>
#include <Graphic3d_Group.hxx>
#include <Prs3d_Arrow.hxx>
#include <Prs3d_ArrowAspect.hxx>
#include <Prs3d_LineAspect.hxx>
#include <Prs3d_LengthAspect.hxx>
#include <TCollection_AsciiString.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_AspectLine3d.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
#include <Prs3d_Text.hxx>
void Prs3d_LengthPresentation::Draw (
const Handle(Prs3d_Presentation)& aPresentation,
const Handle(Prs3d_Drawer)& aDrawer,
const TCollection_ExtendedString& aText,
const gp_Pnt& AttachmentPoint1,
const gp_Pnt& AttachmentPoint2,
const gp_Pnt& OffsetPoint)
{
Handle(Prs3d_LengthAspect) LA = aDrawer->LengthAspect();
Prs3d_Root::CurrentGroup(aPresentation)->SetPrimitivesAspect(LA->LineAspect()->Aspect());
gp_Dir D (gp_Vec(AttachmentPoint1,AttachmentPoint2));
gp_Lin L (OffsetPoint,D);
gp_Pnt Proj1 = ElCLib::Value(ElCLib::Parameter(L,AttachmentPoint1),L);
gp_Pnt Proj2 = ElCLib::Value(ElCLib::Parameter(L,AttachmentPoint2),L);
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;
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;
Proj2.Coord(X2,Y2,Z2);
if (LA->DrawSecondArrow())
Prs3d_Arrow::Draw(aPresentation,Proj2,D,LA->Arrow2Aspect()->Angle(),LA->Arrow2Aspect()->Length());
gp_Pnt p( .5*(X+X2), .5*(Y+Y2), .5*(Z+Z2) );
Prs3d_Text::Draw(aPresentation,LA->TextAspect(),aText,p);
}

View File

@@ -19,7 +19,7 @@
-- and conditions governing the rights and limitations under the License.
class PlaneAspect from Prs3d inherits CompositeAspect from Prs3d
class PlaneAspect from Prs3d inherits BasicAspect from Prs3d
---Purpose: A framework to define the display of planes.
uses

View File

@@ -1,47 +0,0 @@
-- Created on: 1993-06-03
-- Created by: Jean-Louis FRENKEL
-- Copyright (c) 1993-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 RadiusAspect from Prs3d inherits CompositeAspect from Prs3d
---Purpose: defines the attributes when drawing a Radius Presentation.
uses
AspectLine3d from Graphic3d,
NameOfColor from Quantity,
TypeOfLine from Aspect
is
--
-- Attributes for the lines.
--
Create (aColor: NameOfColor from Quantity;
aType: TypeOfLine from Aspect;
aWidth: Real from Standard)
returns mutable RadiusAspect from Prs3d;
---Purpose: Constructs the framework to define the display of radii.
-- This consists of the attributes:
-- - the color aColor
-- - the type of line aType and
-- - the width aWidth of the line.
end RadiusAspect from Prs3d;

View File

@@ -1,24 +0,0 @@
// Copyright (c) 1995-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.
#include <Prs3d_RadiusAspect.ixx>
Prs3d_RadiusAspect::Prs3d_RadiusAspect(const Quantity_NameOfColor /*aColor*/,
const Aspect_TypeOfLine /*aType*/,
const Standard_Real /*aWidth*/) {
}