mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-29 14:00:49 +03:00
0028726: Quantity_NameOfColor should be replaced by Quantity_Color in function input argument
AIS_InteractiveObject, virtual methods ::SetColor(), ::Color() returning/accepting Quantity_NameOfColor have been removed. Virtual method ::SetMaterial() accepting Graphic3d_NameOfMaterial has been also removed. V3d_View, V3d_Viewer, V3d_AmbientLight, V3d_DirectionalLight, V3d_Light, V3d_PositionalLight, V3d_SpotLight, Aspect_Window, methods accepting Quantity_NameOfColor have been removed (duplicates) or color argument(s) replaced with Quantity_Color.
This commit is contained in:
@@ -47,7 +47,11 @@ Standard_Boolean AIS_AttributeFilter::IsOk(const Handle(SelectMgr_EntityOwner)&
|
||||
|
||||
Standard_Boolean okstat = Standard_True;
|
||||
if( hasC && aSelectable->HasColor() )
|
||||
okstat = (myCol == aSelectable->Color());
|
||||
{
|
||||
Quantity_Color aColor;
|
||||
aSelectable->Color (aColor);
|
||||
okstat = (myCol == aColor.Name());
|
||||
}
|
||||
|
||||
if( hasW && aSelectable->HasWidth() )
|
||||
okstat = (myWid == aSelectable->Width()) && okstat;
|
||||
|
@@ -14,8 +14,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <AIS_Axis.hxx>
|
||||
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <DsgPrs_XYZAxisPresentation.hxx>
|
||||
#include <Geom_Axis1Placement.hxx>
|
||||
@@ -85,7 +85,7 @@ myIsXYZAxis(Standard_True)
|
||||
aLength = 0.1;
|
||||
}
|
||||
DA->SetAxisLength(aLength,aLength,aLength);
|
||||
Quantity_NameOfColor col = Quantity_NOC_TURQUOISE;
|
||||
Quantity_Color col (Quantity_NOC_TURQUOISE);
|
||||
DA->LineAspect(Prs3d_DP_XAxis)->SetColor(col);
|
||||
DA->LineAspect(Prs3d_DP_YAxis)->SetColor(col);
|
||||
DA->LineAspect(Prs3d_DP_ZAxis)->SetColor(col);
|
||||
@@ -209,15 +209,8 @@ void AIS_Axis::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
|
||||
void AIS_Axis::SetColor(const Quantity_NameOfColor aCol)
|
||||
{
|
||||
SetColor(Quantity_Color(aCol));
|
||||
}
|
||||
|
||||
void AIS_Axis::SetColor(const Quantity_Color &aCol)
|
||||
{
|
||||
hasOwnColor=Standard_True;
|
||||
|
@@ -17,33 +17,16 @@
|
||||
#ifndef _AIS_Axis_HeaderFile
|
||||
#define _AIS_Axis_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <AIS_TypeOfAxis.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_CString.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <AIS_TypeOfAxis.hxx>
|
||||
#include <gp_Dir.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
|
||||
class Geom_Line;
|
||||
class Geom_Axis1Placement;
|
||||
class Geom_Axis2Placement;
|
||||
class Prs3d_LineAspect;
|
||||
class Geom_Axis1Placement;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class Quantity_Color;
|
||||
|
||||
|
||||
class AIS_Axis;
|
||||
DEFINE_STANDARD_HANDLE(AIS_Axis, AIS_InteractiveObject)
|
||||
|
||||
//! Locates the x, y and z axes in an Interactive Object.
|
||||
//! These are used to orient it correctly in presentations
|
||||
@@ -53,34 +36,30 @@ DEFINE_STANDARD_HANDLE(AIS_Axis, AIS_InteractiveObject)
|
||||
//! then situated relative to one of the axes of the view.
|
||||
class AIS_Axis : public AIS_InteractiveObject
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Axis, AIS_InteractiveObject)
|
||||
public:
|
||||
|
||||
|
||||
//! Initializes the line aComponent
|
||||
Standard_EXPORT AIS_Axis(const Handle(Geom_Line)& aComponent);
|
||||
|
||||
|
||||
//! initializes the axis2 position
|
||||
//! aComponent. The coordinate system used is right-handed.
|
||||
Standard_EXPORT AIS_Axis(const Handle(Geom_Axis2Placement)& aComponent, const AIS_TypeOfAxis anAxisType);
|
||||
|
||||
|
||||
//! Initializes the axis1 position anAxis.
|
||||
Standard_EXPORT AIS_Axis(const Handle(Geom_Axis1Placement)& anAxis);
|
||||
|
||||
|
||||
//! Returns the axis entity aComponent and identifies it
|
||||
//! as a component of a shape.
|
||||
const Handle(Geom_Line)& Component() const;
|
||||
|
||||
const Handle(Geom_Line)& Component() const { return myComponent; }
|
||||
|
||||
//! Sets the coordinates of the lin aComponent.
|
||||
Standard_EXPORT void SetComponent (const Handle(Geom_Line)& aComponent);
|
||||
|
||||
|
||||
//! Returns the position of axis2 and positions it by
|
||||
//! identifying it as the x, y, or z axis and giving its
|
||||
//! direction in 3D space. The coordinate system used is right-handed.
|
||||
const Handle(Geom_Axis2Placement)& Axis2Placement() const;
|
||||
|
||||
const Handle(Geom_Axis2Placement)& Axis2Placement() const { return myAx2; }
|
||||
|
||||
//! Allows you to provide settings for aComponent:the
|
||||
//! position and direction of an axis in 3D space. The
|
||||
@@ -91,19 +70,17 @@ public:
|
||||
Standard_EXPORT void SetAxis1Placement (const Handle(Geom_Axis1Placement)& anAxis);
|
||||
|
||||
//! Returns the type of axis.
|
||||
AIS_TypeOfAxis TypeOfAxis() const;
|
||||
|
||||
AIS_TypeOfAxis TypeOfAxis() const { return myTypeOfAxis; }
|
||||
|
||||
//! Constructs the entity aTypeAxis to stock information
|
||||
//! Constructs the entity theTypeAxis to stock information
|
||||
//! concerning type of axis.
|
||||
void SetTypeOfAxis (const AIS_TypeOfAxis aTypeAxis);
|
||||
|
||||
void SetTypeOfAxis (const AIS_TypeOfAxis theTypeAxis) { myTypeOfAxis = theTypeAxis; }
|
||||
|
||||
//! Returns a signature of 2 for axis datums. When you
|
||||
//! activate mode 2 by a signature, you pick AIS objects
|
||||
//! of type AIS_Axis.
|
||||
Standard_Boolean IsXYZAxis() const;
|
||||
|
||||
Standard_Boolean IsXYZAxis() const { return myIsXYZAxis; }
|
||||
|
||||
//! Returns true if the interactive object accepts the display mode aMode.
|
||||
Standard_EXPORT Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE;
|
||||
|
||||
@@ -115,13 +92,11 @@ public:
|
||||
//! WARNING :<aTrsf> must be applied
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE;
|
||||
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor) Standard_OVERRIDE;
|
||||
|
||||
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 2; }
|
||||
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
|
||||
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void SetWidth (const Standard_Real aValue) Standard_OVERRIDE;
|
||||
@@ -130,19 +105,8 @@ public:
|
||||
|
||||
Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Axis,AIS_InteractiveObject)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -151,6 +115,8 @@ private:
|
||||
|
||||
Standard_EXPORT void ComputeFields();
|
||||
|
||||
private:
|
||||
|
||||
Handle(Geom_Line) myComponent;
|
||||
Handle(Geom_Axis2Placement) myAx2;
|
||||
gp_Pnt myPfirst;
|
||||
@@ -162,14 +128,8 @@ private:
|
||||
Standard_CString myText;
|
||||
Handle(Prs3d_LineAspect) myLineAspect;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_Axis.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Axis, AIS_InteractiveObject)
|
||||
|
||||
#endif // _AIS_Axis_HeaderFile
|
||||
|
@@ -1,69 +0,0 @@
|
||||
// Created on: 1997-03-03
|
||||
// Created by: Jean-Pierre COMBE
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//=======================================================================
|
||||
//function : Component
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const Handle(Geom_Line)& AIS_Axis::Component() const
|
||||
{
|
||||
return myComponent;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Axis2Placement
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const Handle(Geom_Axis2Placement)& AIS_Axis::Axis2Placement() const
|
||||
{
|
||||
return myAx2;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : TypeOfAxis:
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline AIS_TypeOfAxis AIS_Axis::TypeOfAxis() const
|
||||
{
|
||||
return myTypeOfAxis;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetTypeOfAxis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void AIS_Axis::SetTypeOfAxis(const AIS_TypeOfAxis aTypeAxis)
|
||||
{
|
||||
myTypeOfAxis = aTypeAxis;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsXYZAxis
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Boolean AIS_Axis::IsXYZAxis() const
|
||||
{
|
||||
return myIsXYZAxis;
|
||||
}
|
||||
inline AIS_KindOfInteractive AIS_Axis::Type() const
|
||||
{return AIS_KOI_Datum;}
|
||||
|
||||
|
||||
inline Standard_Integer AIS_Axis::Signature() const
|
||||
{return 2;}
|
@@ -14,8 +14,8 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
|
||||
#include <AIS_Circle.hxx>
|
||||
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <GC_MakeArcOfCircle.hxx>
|
||||
@@ -112,17 +112,6 @@ void AIS_Circle::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
||||
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Circle::SetColor(const Quantity_NameOfColor aCol)
|
||||
{
|
||||
SetColor(Quantity_Color(aCol));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
|
@@ -17,35 +17,17 @@
|
||||
#ifndef _AIS_Circle_HeaderFile
|
||||
#define _AIS_Circle_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
|
||||
class Geom_Circle;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class Quantity_Color;
|
||||
|
||||
|
||||
class AIS_Circle;
|
||||
DEFINE_STANDARD_HANDLE(AIS_Circle, AIS_InteractiveObject)
|
||||
|
||||
//! Constructs circle datums to be used in construction of
|
||||
//! composite shapes.
|
||||
class AIS_Circle : public AIS_InteractiveObject
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Circle, AIS_InteractiveObject)
|
||||
public:
|
||||
|
||||
|
||||
//! Initializes this algorithm for constructing AIS circle
|
||||
//! datums initializes the circle aCircle
|
||||
Standard_EXPORT AIS_Circle(const Handle(Geom_Circle)& aCircle);
|
||||
@@ -66,31 +48,39 @@ public:
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
//! Returns index 6 by default.
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE;
|
||||
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 6; }
|
||||
|
||||
//! Indicates that the type of Interactive Object is a datum.
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
|
||||
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
|
||||
|
||||
//! Returns the circle component defined in SetCircle.
|
||||
const Handle(Geom_Circle)& Circle() const;
|
||||
|
||||
const Handle(Geom_Circle)& Circle() const { return myComponent; }
|
||||
|
||||
//! Constructs instances of the starting point and the end
|
||||
//! point parameters, u1 and u2.
|
||||
void Parameters (Standard_Real& u1, Standard_Real& u2) const;
|
||||
|
||||
//! point parameters, theU1 and theU2.
|
||||
void Parameters (Standard_Real& theU1, Standard_Real& theU2) const
|
||||
{
|
||||
theU1 = myUStart;
|
||||
theU2 = myUEnd;
|
||||
}
|
||||
|
||||
//! Allows you to provide settings for the circle datum aCircle.
|
||||
void SetCircle (const Handle(Geom_Circle)& aCircle);
|
||||
|
||||
//! Allows you to set the parameter u for the starting point of an arc.
|
||||
void SetFirstParam (const Standard_Real u);
|
||||
|
||||
//! Allows you to provide the parameter u for the end point of an arc.
|
||||
void SetLastParam (const Standard_Real u);
|
||||
|
||||
//! Assigns the color aColor to the solid line boundary of the circle datum.
|
||||
Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor) Standard_OVERRIDE;
|
||||
|
||||
void SetCircle (const Handle(Geom_Circle)& theCircle) { myComponent = theCircle; }
|
||||
|
||||
//! Allows you to set the parameter theU for the starting point of an arc.
|
||||
void SetFirstParam (const Standard_Real theU)
|
||||
{
|
||||
myUStart = theU;
|
||||
myCircleIsArc = Standard_True;
|
||||
}
|
||||
|
||||
//! Allows you to provide the parameter theU for the end point of an arc.
|
||||
void SetLastParam (const Standard_Real theU)
|
||||
{
|
||||
myUEnd = theU;
|
||||
myCircleIsArc = Standard_True;
|
||||
}
|
||||
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
|
||||
|
||||
//! Assigns the width aValue to the solid line boundary of the circle datum.
|
||||
@@ -103,25 +93,14 @@ public:
|
||||
Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
|
||||
|
||||
//! Returns the type of sensitivity for the circle;
|
||||
Standard_Boolean IsFilledCircleSens() const;
|
||||
|
||||
Standard_Boolean IsFilledCircleSens() const { return myIsFilledCircleSens; }
|
||||
|
||||
//! Sets the type of sensitivity for the circle. If theIsFilledCircleSens set to Standard_True
|
||||
//! then the whole circle will be detectable, otherwise only the boundary of the circle.
|
||||
void SetFilledCircleSens (const Standard_Boolean theIsFilledCircleSens);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Circle,AIS_InteractiveObject)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
void SetFilledCircleSens (const Standard_Boolean theIsFilledCircleSens) { myIsFilledCircleSens = theIsFilledCircleSens; }
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -136,20 +115,16 @@ private:
|
||||
|
||||
Standard_EXPORT void ComputeArcSelection (const Handle(SelectMgr_Selection)& aSelection);
|
||||
|
||||
private:
|
||||
|
||||
Handle(Geom_Circle) myComponent;
|
||||
Standard_Real myUStart;
|
||||
Standard_Real myUEnd;
|
||||
Standard_Boolean myCircleIsArc;
|
||||
Standard_Boolean myIsFilledCircleSens;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_Circle.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Circle, AIS_InteractiveObject)
|
||||
|
||||
#endif // _AIS_Circle_HeaderFile
|
||||
|
@@ -1,47 +0,0 @@
|
||||
// Created on: 1997-03-06
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
inline AIS_KindOfInteractive AIS_Circle::Type() const
|
||||
{return AIS_KOI_Datum;}
|
||||
|
||||
|
||||
inline Standard_Integer AIS_Circle::Signature() const
|
||||
{return 6;}
|
||||
|
||||
inline const Handle(Geom_Circle)&
|
||||
AIS_Circle::Circle() const
|
||||
{return myComponent;}
|
||||
|
||||
inline void AIS_Circle::Parameters(Standard_Real& U1,Standard_Real& U2) const
|
||||
{U1=myUStart;U2=myUEnd;}
|
||||
|
||||
inline void AIS_Circle::SetCircle(const Handle(Geom_Circle)& C)
|
||||
{myComponent=C;}
|
||||
|
||||
inline void AIS_Circle::SetFirstParam(const Standard_Real U)
|
||||
{myUStart=U;myCircleIsArc = Standard_True;}
|
||||
inline void AIS_Circle::SetLastParam(const Standard_Real U)
|
||||
{myUEnd=U; myCircleIsArc = Standard_True;}
|
||||
|
||||
inline Standard_Boolean AIS_Circle::IsFilledCircleSens() const
|
||||
{
|
||||
return myIsFilledCircleSens;
|
||||
}
|
||||
|
||||
inline void AIS_Circle::SetFilledCircleSens (const Standard_Boolean theIsFilledCircleSens)
|
||||
{
|
||||
myIsFilledCircleSens = theIsFilledCircleSens;
|
||||
}
|
@@ -94,7 +94,9 @@ AIS_ColoredShape::AIS_ColoredShape (const Handle(AIS_Shape)& theShape)
|
||||
}
|
||||
if (theShape->HasColor())
|
||||
{
|
||||
SetColor (theShape->Color());
|
||||
Quantity_Color aColor;
|
||||
theShape->Color (aColor);
|
||||
SetColor (aColor);
|
||||
}
|
||||
if (theShape->HasWidth())
|
||||
{
|
||||
|
@@ -1763,17 +1763,6 @@ void AIS_InteractiveContext::redisplayPrsModes (const Handle(AIS_InteractiveObje
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::SetColor (const Handle(AIS_InteractiveObject)& theIObj,
|
||||
const Quantity_NameOfColor theColor,
|
||||
const Standard_Boolean theToUpdateViewer)
|
||||
{
|
||||
SetColor (theIObj, Quantity_Color(theColor), theToUpdateViewer);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
@@ -2015,15 +2004,6 @@ Standard_Boolean AIS_InteractiveContext::HasColor (const Handle(AIS_InteractiveO
|
||||
return theIObj->HasColor();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Color
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Quantity_NameOfColor AIS_InteractiveContext::Color (const Handle(AIS_InteractiveObject)& theIObj) const
|
||||
{
|
||||
return theIObj->Color();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Color
|
||||
//purpose :
|
||||
@@ -2098,7 +2078,7 @@ void AIS_InteractiveContext::UnsetWidth (const Handle(AIS_InteractiveObject)& th
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveContext::SetMaterial (const Handle(AIS_InteractiveObject)& theIObj,
|
||||
const Graphic3d_NameOfMaterial theName,
|
||||
const Graphic3d_MaterialAspect& theMaterial,
|
||||
const Standard_Boolean theToUpdateViewer)
|
||||
{
|
||||
if (theIObj.IsNull())
|
||||
@@ -2107,7 +2087,7 @@ void AIS_InteractiveContext::SetMaterial (const Handle(AIS_InteractiveObject)& t
|
||||
}
|
||||
|
||||
setContextToObject (theIObj);
|
||||
theIObj->SetMaterial (theName);
|
||||
theIObj->SetMaterial (theMaterial);
|
||||
redisplayPrsRecModes (theIObj, theToUpdateViewer);
|
||||
}
|
||||
|
||||
@@ -2735,7 +2715,7 @@ void AIS_InteractiveContext::InitAttributes()
|
||||
Handle(Prs3d_DatumAspect) aTrihAspect = myDefaultDrawer->DatumAspect();
|
||||
const Standard_Real aLength = 100.0;
|
||||
aTrihAspect->SetAxisLength (aLength, aLength, aLength);
|
||||
const Quantity_NameOfColor aColor = Quantity_NOC_LIGHTSTEELBLUE4;
|
||||
const Quantity_Color aColor = Quantity_NOC_LIGHTSTEELBLUE4;
|
||||
aTrihAspect->LineAspect(Prs3d_DP_XAxis)->SetColor (aColor);
|
||||
aTrihAspect->LineAspect(Prs3d_DP_YAxis)->SetColor (aColor);
|
||||
aTrihAspect->LineAspect(Prs3d_DP_ZAxis)->SetColor (aColor);
|
||||
|
@@ -29,7 +29,6 @@
|
||||
#include <AIS_StatusOfPick.hxx>
|
||||
#include <AIS_TypeOfIso.hxx>
|
||||
#include <Aspect_TypeOfFacingModel.hxx>
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_TypeOfHighlight.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
@@ -439,11 +438,6 @@ public:
|
||||
//! default facing model is Aspect_TOFM_TWO_SIDE. This mean that attributes is
|
||||
//! applying both on the front and back face.
|
||||
Standard_EXPORT void SetCurrentFacingModel (const Handle(AIS_InteractiveObject)& aniobj, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
|
||||
|
||||
Standard_EXPORT void SetColor (const Handle(AIS_InteractiveObject)& theIObj,
|
||||
const Quantity_NameOfColor theColor,
|
||||
const Standard_Boolean theToUpdateViewer);
|
||||
|
||||
|
||||
//! Sets the color of the selected entity.
|
||||
//! If a local context is open and if updateviewer equals
|
||||
@@ -484,14 +478,12 @@ public:
|
||||
|
||||
//! Provides the type of material setting for the view of
|
||||
//! the entity aniobj.
|
||||
//! The range of settings includes: BRASS, BRONZE,
|
||||
//! GOLD, PEWTER, SILVER, STONE.
|
||||
//! If a local context is open and if updateviewer equals
|
||||
//! Standard_False, the presentation of the Interactive
|
||||
//! Object activates the selection mode; the object is
|
||||
//! displayed but no viewer will be updated.
|
||||
Standard_EXPORT void SetMaterial (const Handle(AIS_InteractiveObject)& theIObj,
|
||||
const Graphic3d_NameOfMaterial theName,
|
||||
const Graphic3d_MaterialAspect& theMaterial,
|
||||
const Standard_Boolean theToUpdateViewer);
|
||||
|
||||
|
||||
@@ -648,9 +640,6 @@ public:
|
||||
|
||||
//! Returns true if a view of the Interactive Object aniobj has color.
|
||||
Standard_EXPORT Standard_Boolean HasColor (const Handle(AIS_InteractiveObject)& aniobj) const;
|
||||
|
||||
Standard_EXPORT Quantity_NameOfColor Color (const Handle(AIS_InteractiveObject)& aniobj) const;
|
||||
|
||||
|
||||
//! Returns the color Color of the entity aniobj in the interactive context.
|
||||
Standard_EXPORT void Color (const Handle(AIS_InteractiveObject)& aniobj, Quantity_Color& acolor) const;
|
||||
|
@@ -53,7 +53,6 @@ AIS_InteractiveObject::AIS_InteractiveObject (const PrsMgr_TypeOfPresentation3d
|
||||
: SelectMgr_SelectableObject (aTypeOfPresentation3d),
|
||||
myCTXPtr (NULL),
|
||||
myOwnWidth (0.0),
|
||||
myOwnMaterial (Graphic3d_NOM_DEFAULT),
|
||||
myCurrentFacingModel (Aspect_TOFM_BOTH_SIDE),
|
||||
myInfiniteState (Standard_False),
|
||||
hasOwnColor (Standard_False),
|
||||
@@ -180,16 +179,6 @@ Aspect_TypeOfFacingModel AIS_InteractiveObject::CurrentFacingModel() const {
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_InteractiveObject::SetColor(const Quantity_NameOfColor aColor)
|
||||
{
|
||||
SetColor(Quantity_Color(aColor));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_InteractiveObject::SetColor(const Quantity_Color& theColor)
|
||||
{
|
||||
myDrawer->SetColor (theColor);
|
||||
@@ -223,29 +212,18 @@ void AIS_InteractiveObject::UnsetWidth()
|
||||
myOwnWidth = 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMaterial
|
||||
//function : Material
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetMaterial (const Graphic3d_NameOfMaterial theName)
|
||||
Graphic3d_NameOfMaterial AIS_InteractiveObject::Material() const
|
||||
{
|
||||
if (!myDrawer->HasOwnShadingAspect())
|
||||
{
|
||||
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
|
||||
if (myDrawer->HasLink())
|
||||
{
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
myDrawer->ShadingAspect()->SetMaterial (theName);
|
||||
myOwnMaterial = theName;
|
||||
hasOwnMaterial = Standard_True;
|
||||
return myDrawer->ShadingAspect()->Material().Name();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMaterial
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_InteractiveObject::SetMaterial (const Graphic3d_MaterialAspect& theMaterial)
|
||||
{
|
||||
@@ -257,6 +235,7 @@ void AIS_InteractiveObject::SetMaterial (const Graphic3d_MaterialAspect& theMate
|
||||
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
|
||||
}
|
||||
}
|
||||
|
||||
myDrawer->ShadingAspect()->SetMaterial (theMaterial);
|
||||
hasOwnMaterial = Standard_True;
|
||||
}
|
||||
|
@@ -119,17 +119,12 @@ public:
|
||||
|
||||
//! Returns the current facing model which is in effect.
|
||||
Standard_EXPORT Aspect_TypeOfFacingModel CurrentFacingModel() const;
|
||||
|
||||
Standard_EXPORT virtual void SetColor (const Quantity_Color& aColor);
|
||||
|
||||
//! only the interactive obj knowns which Drawer attribute
|
||||
//! is affected by the color (ex: for a wire, it's the
|
||||
//! wireaspect field of the drawer, but for a vertex, only
|
||||
//! the point aspect field is affected by the color)
|
||||
//! WARNING : Do not forget to set the corresponding fields
|
||||
//! here (hasOwnColor and myDrawer->SetColor())
|
||||
Standard_EXPORT virtual void SetColor (const Quantity_NameOfColor aColor);
|
||||
|
||||
|
||||
//! Only the interactive object knowns which Drawer attribute is affected by the color, if any
|
||||
//! (ex: for a wire,it's the wireaspect field of the drawer, but for a vertex, only the point aspect field is affected by the color).
|
||||
//! WARNING : Do not forget to set the corresponding fields here (hasOwnColor and myDrawer->SetColor())
|
||||
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor);
|
||||
|
||||
//! Removes color settings. Only the Interactive Object
|
||||
//! knows which Drawer attribute is affected by the color
|
||||
//! setting. For a wire, for example, wire aspect is the
|
||||
@@ -285,8 +280,6 @@ public:
|
||||
Standard_Boolean HasColor() const { return hasOwnColor; }
|
||||
|
||||
//! Returns the color setting of the Interactive Object.
|
||||
virtual Quantity_NameOfColor Color() const { return myDrawer->Color().Name(); }
|
||||
|
||||
virtual void Color (Quantity_Color& theColor) const { theColor = myDrawer->Color(); }
|
||||
|
||||
//! Returns true if the Interactive Object has width.
|
||||
@@ -306,14 +299,8 @@ public:
|
||||
//! - Pewter
|
||||
//! - Silver
|
||||
//! - Stone.
|
||||
virtual Graphic3d_NameOfMaterial Material() const { return myOwnMaterial; }
|
||||
Standard_EXPORT virtual Graphic3d_NameOfMaterial Material() const;
|
||||
|
||||
//! Sets the name aName for material defining this
|
||||
//! display attribute for the interactive object.
|
||||
//! Material aspect determines shading aspect, color and
|
||||
//! transparency of visible entities.
|
||||
Standard_EXPORT virtual void SetMaterial (const Graphic3d_NameOfMaterial aName);
|
||||
|
||||
//! Sets the material aMat defining this display attribute
|
||||
//! for the interactive object.
|
||||
//! Material aspect determines shading aspect, color and
|
||||
@@ -424,7 +411,6 @@ protected:
|
||||
|
||||
TColStd_ListOfInteger myToRecomputeModes;
|
||||
Standard_Real myOwnWidth;
|
||||
Graphic3d_NameOfMaterial myOwnMaterial;
|
||||
Aspect_TypeOfFacingModel myCurrentFacingModel;
|
||||
Standard_Boolean myInfiniteState;
|
||||
Standard_Boolean hasOwnColor;
|
||||
|
@@ -14,9 +14,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AIS_Line.hxx>
|
||||
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
#include <AIS_Line.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <GC_MakeSegment.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
@@ -152,17 +152,10 @@ void AIS_Line::ComputeSelection(const Handle(SelectMgr_Selection)& theSelection,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Line::SetColor(const Quantity_NameOfColor aCol)
|
||||
{
|
||||
SetColor(Quantity_Color(aCol));
|
||||
}
|
||||
|
||||
void AIS_Line::SetColor(const Quantity_Color &aCol)
|
||||
{
|
||||
hasOwnColor=Standard_True;
|
||||
|
@@ -17,43 +17,26 @@
|
||||
#ifndef _AIS_Line_HeaderFile
|
||||
#define _AIS_Line_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
|
||||
class Geom_Line;
|
||||
class Geom_Point;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class Quantity_Color;
|
||||
|
||||
|
||||
class AIS_Line;
|
||||
DEFINE_STANDARD_HANDLE(AIS_Line, AIS_InteractiveObject)
|
||||
|
||||
//! Constructs line datums to be used in construction of
|
||||
//! composite shapes.
|
||||
class AIS_Line : public AIS_InteractiveObject
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Line, AIS_InteractiveObject)
|
||||
public:
|
||||
|
||||
|
||||
//! Initializes the line aLine.
|
||||
Standard_EXPORT AIS_Line(const Handle(Geom_Line)& aLine);
|
||||
|
||||
|
||||
//! Initializes a starting point aStartPoint
|
||||
//! and a finishing point aEndPoint for the line.
|
||||
Standard_EXPORT AIS_Line(const Handle(Geom_Point)& aStartPoint, const Handle(Geom_Point)& aEndPoint);
|
||||
|
||||
|
||||
//! computes the presentation according to a point of view
|
||||
//! given by <aProjector>.
|
||||
//! To be Used when the associated degenerated Presentations
|
||||
@@ -62,56 +45,53 @@ public:
|
||||
//! WARNING :<aTrsf> must be applied
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
//! Returns the signature 5.
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the type Datum.
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
|
||||
|
||||
//! Constructs an infinite line.
|
||||
const Handle(Geom_Line)& Line() const;
|
||||
|
||||
//! Returns the starting point PStart and the end point
|
||||
//! PEnd of the line set by SetPoints.
|
||||
void Points (Handle(Geom_Point)& PStart, Handle(Geom_Point)& PEnd) const;
|
||||
|
||||
//! instantiates an infinite line.
|
||||
void SetLine (const Handle(Geom_Line)& L);
|
||||
|
||||
|
||||
//! Sets the starting point P1 and ending point P2 of the
|
||||
//! Returns the signature 5.
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 5; }
|
||||
|
||||
//! Returns the type Datum.
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
|
||||
|
||||
//! Constructs an infinite line.
|
||||
const Handle(Geom_Line)& Line() const { return myComponent; }
|
||||
|
||||
//! Returns the starting point thePStart and the end point thePEnd of the line set by SetPoints.
|
||||
void Points (Handle(Geom_Point)& thePStart, Handle(Geom_Point)& thePEnd) const
|
||||
{
|
||||
thePStart = myStartPoint;
|
||||
thePEnd = myEndPoint;
|
||||
}
|
||||
|
||||
//! instantiates an infinite line.
|
||||
void SetLine (const Handle(Geom_Line)& theLine)
|
||||
{
|
||||
myComponent = theLine;
|
||||
myLineIsSegment = Standard_False;
|
||||
}
|
||||
|
||||
//! Sets the starting point thePStart and ending point thePEnd of the
|
||||
//! infinite line to create a finite line segment.
|
||||
void SetPoints (const Handle(Geom_Point)& P1, const Handle(Geom_Point)& P2);
|
||||
|
||||
//! Provides a new color setting aColor for the line in the
|
||||
//! drawing tool, or "Drawer".
|
||||
Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor) Standard_OVERRIDE;
|
||||
|
||||
void SetPoints (const Handle(Geom_Point)& thePStart, const Handle(Geom_Point)& thePEnd)
|
||||
{
|
||||
myStartPoint = thePStart;
|
||||
myEndPoint = thePEnd;
|
||||
myLineIsSegment = Standard_True;
|
||||
}
|
||||
|
||||
//! Provides a new color setting aColor for the line in the drawing tool, or "Drawer".
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
|
||||
|
||||
|
||||
//! Provides the new width setting aValue for the line in
|
||||
//! the drawing tool, or "Drawer".
|
||||
Standard_EXPORT void SetWidth (const Standard_Real aValue) Standard_OVERRIDE;
|
||||
|
||||
|
||||
//! Removes the color setting and returns the original color.
|
||||
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
|
||||
|
||||
|
||||
//! Removes the width setting and returns the original width.
|
||||
Standard_EXPORT void UnsetWidth() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Line,AIS_InteractiveObject)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
@@ -127,19 +107,15 @@ private:
|
||||
|
||||
Standard_EXPORT void ComputeSegmentLineSelection (const Handle(SelectMgr_Selection)& aSelection);
|
||||
|
||||
private:
|
||||
|
||||
Handle(Geom_Line) myComponent;
|
||||
Handle(Geom_Point) myStartPoint;
|
||||
Handle(Geom_Point) myEndPoint;
|
||||
Standard_Boolean myLineIsSegment;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_Line.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Line, AIS_InteractiveObject)
|
||||
|
||||
#endif // _AIS_Line_HeaderFile
|
||||
|
@@ -1,37 +0,0 @@
|
||||
// Created on: 1997-03-06
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
inline AIS_KindOfInteractive AIS_Line::Type() const
|
||||
{return AIS_KOI_Datum;}
|
||||
|
||||
|
||||
inline Standard_Integer AIS_Line::Signature() const
|
||||
{return 5;}
|
||||
|
||||
inline const Handle(Geom_Line)& AIS_Line::Line() const
|
||||
{return myComponent;}
|
||||
inline void AIS_Line::Points( Handle(Geom_Point)& PStart,
|
||||
Handle(Geom_Point)& PEnd) const
|
||||
{ PStart = myStartPoint; PEnd = myEndPoint;}
|
||||
inline void AIS_Line::SetLine(const Handle(Geom_Line)& L)
|
||||
{myComponent =L;myLineIsSegment=Standard_False;}
|
||||
inline void AIS_Line::SetPoints(const Handle(Geom_Point)& PStart,
|
||||
const Handle(Geom_Point)& PEnd)
|
||||
{
|
||||
myStartPoint=PStart;
|
||||
myEndPoint = PEnd;
|
||||
myLineIsSegment=Standard_True;
|
||||
}
|
@@ -14,9 +14,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AIS_Plane.hxx>
|
||||
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Plane.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <DsgPrs_ShadedPlanePresentation.hxx>
|
||||
#include <DsgPrs_XYZPlanePresentation.hxx>
|
||||
@@ -435,18 +435,10 @@ Standard_Boolean AIS_Plane::Size(Standard_Real& X,Standard_Real& Y) const
|
||||
return Abs(X-Y)<=Precision::Confusion();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
|
||||
void AIS_Plane::SetColor(const Quantity_NameOfColor aCol)
|
||||
{
|
||||
SetColor(Quantity_Color(aCol));
|
||||
}
|
||||
|
||||
void AIS_Plane::SetColor(const Quantity_Color &aCol)
|
||||
{
|
||||
// if the plane already has its proper size, there is an already created planeaspect
|
||||
@@ -496,8 +488,7 @@ void AIS_Plane::UnsetColor()
|
||||
else{
|
||||
const Handle(Prs3d_PlaneAspect) PA = myDrawer->HasLink() ? myDrawer->Link()->PlaneAspect() :
|
||||
new Prs3d_PlaneAspect();
|
||||
// const Handle(Prs3d_DatumAspect)& DA = myDrawer->Link()->DatumAspect();
|
||||
Quantity_NameOfColor Col = PA->EdgesAspect()->Aspect()->Color().Name();
|
||||
Quantity_Color Col = PA->EdgesAspect()->Aspect()->Color();
|
||||
myDrawer->PlaneAspect()->EdgesAspect()->SetColor(Col);
|
||||
|
||||
myDrawer->DatumAspect()->LineAspect(Prs3d_DP_XAxis)->SetColor(Col);
|
||||
|
@@ -17,41 +17,22 @@
|
||||
#ifndef _AIS_Plane_HeaderFile
|
||||
#define _AIS_Plane_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <AIS_TypeOfPlane.hxx>
|
||||
#include <Select3D_TypeOfSensitivity.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <AIS_TypeOfPlane.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <Select3D_TypeOfSensitivity.hxx>
|
||||
|
||||
class Geom_Plane;
|
||||
class Geom_Axis2Placement;
|
||||
class gp_Pnt;
|
||||
class AIS_InteractiveContext;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class Quantity_Color;
|
||||
|
||||
|
||||
class AIS_Plane;
|
||||
DEFINE_STANDARD_HANDLE(AIS_Plane, AIS_InteractiveObject)
|
||||
|
||||
//! Constructs plane datums to be used in construction of
|
||||
//! composite shapes.
|
||||
class AIS_Plane : public AIS_InteractiveObject
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Plane, AIS_InteractiveObject)
|
||||
public:
|
||||
|
||||
|
||||
//! initializes the plane aComponent. If
|
||||
//! the mode aCurrentMode equals true, the drawing
|
||||
//! tool, "Drawer" is not initialized.
|
||||
@@ -82,16 +63,16 @@ public:
|
||||
Standard_EXPORT void UnsetSize();
|
||||
|
||||
Standard_EXPORT Standard_Boolean Size (Standard_Real& X, Standard_Real& Y) const;
|
||||
|
||||
Standard_Boolean HasOwnSize() const;
|
||||
|
||||
|
||||
Standard_Boolean HasOwnSize() const { return myHasOwnSize; }
|
||||
|
||||
Standard_EXPORT virtual Standard_Integer Signature() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the component specified in SetComponent.
|
||||
const Handle(Geom_Plane)& Component();
|
||||
|
||||
const Handle(Geom_Plane)& Component() { return myComponent; }
|
||||
|
||||
//! Creates an instance of the plane aComponent.
|
||||
Standard_EXPORT void SetComponent (const Handle(Geom_Plane)& aComponent);
|
||||
|
||||
@@ -104,14 +85,13 @@ public:
|
||||
//! for the selected plane. These include: center point
|
||||
//! aCenter, maximum aPmax and minimum aPmin.
|
||||
Standard_EXPORT void SetPlaneAttributes (const Handle(Geom_Plane)& aComponent, const gp_Pnt& aCenter, const gp_Pnt& aPmin, const gp_Pnt& aPmax);
|
||||
|
||||
//! Returns the coordinates of the center point.
|
||||
const gp_Pnt& Center() const;
|
||||
|
||||
|
||||
//! Provides settings for the center aCenter other than (0, 0, 0).
|
||||
void SetCenter (const gp_Pnt& aCenter);
|
||||
|
||||
//! Returns the coordinates of the center point.
|
||||
const gp_Pnt& Center() const { return myCenter; }
|
||||
|
||||
//! Provides settings for the center theCenter other than (0, 0, 0).
|
||||
void SetCenter (const gp_Pnt& theCenter) { myCenter = theCenter; }
|
||||
|
||||
//! Allows you to provide settings for the position and
|
||||
//! direction of one of the plane's axes, aComponent, in
|
||||
//! 3D space. The coordinate system used is
|
||||
@@ -128,31 +108,30 @@ public:
|
||||
Standard_EXPORT Handle(Geom_Axis2Placement) Axis2Placement();
|
||||
|
||||
//! Returns the type of plane - xy, yz, xz or unknown.
|
||||
AIS_TypeOfPlane TypeOfPlane();
|
||||
|
||||
AIS_TypeOfPlane TypeOfPlane() { return myTypeOfPlane; }
|
||||
|
||||
//! Returns the type of plane - xy, yz, or xz.
|
||||
Standard_Boolean IsXYZPlane();
|
||||
|
||||
Standard_Boolean IsXYZPlane() { return myIsXYZPlane; }
|
||||
|
||||
//! Returns the non-default current display mode set by SetCurrentMode.
|
||||
Standard_Boolean CurrentMode();
|
||||
|
||||
Standard_Boolean CurrentMode() { return myCurrentMode; }
|
||||
|
||||
//! Allows you to provide settings for a non-default
|
||||
//! current display mode.
|
||||
void SetCurrentMode (const Standard_Boolean aCurrentMode);
|
||||
|
||||
void SetCurrentMode (const Standard_Boolean theCurrentMode) { myCurrentMode = theCurrentMode; }
|
||||
|
||||
//! Returns true if the display mode selected, aMode, is valid for planes.
|
||||
Standard_EXPORT virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE;
|
||||
|
||||
//! connection to <aCtx> default drawer implies a recomputation of Frame values.
|
||||
Standard_EXPORT virtual void SetContext (const Handle(AIS_InteractiveContext)& aCtx) Standard_OVERRIDE;
|
||||
|
||||
|
||||
//! Returns the type of sensitivity for the plane;
|
||||
Select3D_TypeOfSensitivity TypeOfSensitivity() const;
|
||||
|
||||
Select3D_TypeOfSensitivity TypeOfSensitivity() const { return myTypeOfSensitivity; }
|
||||
|
||||
//! Sets the type of sensitivity for the plane.
|
||||
void SetTypeOfSensitivity (const Select3D_TypeOfSensitivity& theTypeOfSensitivity);
|
||||
|
||||
void SetTypeOfSensitivity (Select3D_TypeOfSensitivity theTypeOfSensitivity) { myTypeOfSensitivity = theTypeOfSensitivity; }
|
||||
|
||||
//! computes the presentation according to a point of view
|
||||
//! given by <aProjector>.
|
||||
//! To be Used when the associated degenerated Presentations
|
||||
@@ -163,26 +142,13 @@ public:
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void ComputeSelection (const Handle(SelectMgr_Selection)& theSelection, const Standard_Integer theMode) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor) Standard_OVERRIDE;
|
||||
|
||||
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
|
||||
|
||||
|
||||
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Plane,AIS_InteractiveObject)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -193,6 +159,8 @@ private:
|
||||
|
||||
Standard_EXPORT void InitDrawerAttributes();
|
||||
|
||||
private:
|
||||
|
||||
Handle(Geom_Plane) myComponent;
|
||||
Handle(Geom_Axis2Placement) myAx2;
|
||||
gp_Pnt myCenter;
|
||||
@@ -205,14 +173,8 @@ private:
|
||||
Standard_Boolean myHasOwnSize;
|
||||
Select3D_TypeOfSensitivity myTypeOfSensitivity;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_Plane.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Plane, AIS_InteractiveObject)
|
||||
|
||||
#endif // _AIS_Plane_HeaderFile
|
||||
|
@@ -1,56 +0,0 @@
|
||||
// Created on: 1997-03-06
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
inline Standard_Boolean AIS_Plane::HasOwnSize() const
|
||||
{return myHasOwnSize;}
|
||||
|
||||
inline const Handle(Geom_Plane)& AIS_Plane::Component()
|
||||
{return myComponent;}
|
||||
|
||||
inline AIS_TypeOfPlane AIS_Plane::TypeOfPlane()
|
||||
{return myTypeOfPlane;}
|
||||
|
||||
inline Standard_Boolean AIS_Plane::IsXYZPlane()
|
||||
{
|
||||
return myIsXYZPlane;
|
||||
}
|
||||
|
||||
|
||||
inline Standard_Boolean AIS_Plane::CurrentMode()
|
||||
{return myCurrentMode;}
|
||||
|
||||
inline void AIS_Plane::SetCurrentMode(const Standard_Boolean aCurrentMode)
|
||||
{myCurrentMode = aCurrentMode;}
|
||||
|
||||
inline const gp_Pnt& AIS_Plane::Center() const
|
||||
{
|
||||
return myCenter;
|
||||
}
|
||||
|
||||
inline void AIS_Plane::SetCenter(const gp_Pnt& aCenter)
|
||||
{
|
||||
myCenter = aCenter;
|
||||
}
|
||||
|
||||
inline Select3D_TypeOfSensitivity AIS_Plane::TypeOfSensitivity() const
|
||||
{
|
||||
return myTypeOfSensitivity;
|
||||
}
|
||||
|
||||
inline void AIS_Plane::SetTypeOfSensitivity (const Select3D_TypeOfSensitivity& theTypeOfSensitivity)
|
||||
{
|
||||
myTypeOfSensitivity = theTypeOfSensitivity;
|
||||
}
|
@@ -68,7 +68,7 @@ AIS_PlaneTrihedron::AIS_PlaneTrihedron(const Handle(Geom_Plane)& aPlane)
|
||||
//POP Standard_Real aLength = UnitsAPI::CurrentFromLS (100. ,"LENGTH");
|
||||
Standard_Real aLength = UnitsAPI::AnyToLS (100. ,"mm");
|
||||
DA->SetAxisLength(aLength,aLength,aLength);
|
||||
Quantity_NameOfColor col = Quantity_NOC_ROYALBLUE1;
|
||||
Quantity_Color col (Quantity_NOC_ROYALBLUE1);
|
||||
DA->LineAspect(Prs3d_DP_XAxis)->SetColor(col);
|
||||
DA->LineAspect(Prs3d_DP_YAxis)->SetColor(col);
|
||||
DA->SetDrawDatumAxes(Prs3d_DA_XYAxis);
|
||||
@@ -242,11 +242,6 @@ void AIS_PlaneTrihedron::ComputeSelection(const Handle(SelectMgr_Selection)& aSe
|
||||
}
|
||||
}
|
||||
|
||||
void AIS_PlaneTrihedron::SetColor(const Quantity_NameOfColor aCol)
|
||||
{
|
||||
SetColor(Quantity_Color(aCol));
|
||||
}
|
||||
|
||||
void AIS_PlaneTrihedron::SetColor(const Quantity_Color &aCol)
|
||||
{
|
||||
hasOwnColor=Standard_True;
|
||||
|
@@ -17,31 +17,12 @@
|
||||
#ifndef _AIS_PlaneTrihedron_HeaderFile
|
||||
#define _AIS_PlaneTrihedron_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
class Geom_Plane;
|
||||
class AIS_InteractiveObject;
|
||||
#include <TCollection_AsciiString.hxx>
|
||||
|
||||
class AIS_Line;
|
||||
class AIS_Point;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class Quantity_Color;
|
||||
class TCollection_AsciiString;
|
||||
|
||||
|
||||
class AIS_PlaneTrihedron;
|
||||
DEFINE_STANDARD_HANDLE(AIS_PlaneTrihedron, AIS_InteractiveObject)
|
||||
class Geom_Plane;
|
||||
|
||||
//! To construct a selectable 2d axis system in a 3d
|
||||
//! drawing. This can be placed anywhere in the 3d
|
||||
@@ -62,10 +43,9 @@ DEFINE_STANDARD_HANDLE(AIS_PlaneTrihedron, AIS_InteractiveObject)
|
||||
//! trihedra. Change these values and recalculate the presentation.
|
||||
class AIS_PlaneTrihedron : public AIS_InteractiveObject
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_PlaneTrihedron, AIS_InteractiveObject)
|
||||
public:
|
||||
|
||||
|
||||
//! Initializes the plane aPlane. The plane trihedron is
|
||||
//! constructed from this and an axis.
|
||||
Standard_EXPORT AIS_PlaneTrihedron(const Handle(Geom_Plane)& aPlane);
|
||||
@@ -103,52 +83,37 @@ public:
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE;
|
||||
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 4; }
|
||||
|
||||
//! Returns datum as the type of Interactive Object.
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
|
||||
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
|
||||
|
||||
//! Allows you to provide settings for the color aColor.
|
||||
Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
|
||||
|
||||
void SetXLabel (const TCollection_AsciiString& aLabel);
|
||||
|
||||
void SetYLabel (const TCollection_AsciiString& aLabel);
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
|
||||
|
||||
void SetXLabel (const TCollection_AsciiString& theLabel) { myXLabel = theLabel; }
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_PlaneTrihedron,AIS_InteractiveObject)
|
||||
void SetYLabel (const TCollection_AsciiString& theLabel) { myYLabel = theLabel; }
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
|
||||
|
||||
private:
|
||||
|
||||
Handle(Geom_Plane) myPlane;
|
||||
Handle(AIS_InteractiveObject) myShapes[3];
|
||||
TCollection_AsciiString myXLabel;
|
||||
TCollection_AsciiString myYLabel;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_PlaneTrihedron.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_PlaneTrihedron, AIS_InteractiveObject)
|
||||
|
||||
#endif // _AIS_PlaneTrihedron_HeaderFile
|
||||
|
@@ -1,34 +0,0 @@
|
||||
// Created on: 1997-03-06
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
inline AIS_KindOfInteractive AIS_PlaneTrihedron::Type() const
|
||||
{return AIS_KOI_Datum;}
|
||||
|
||||
|
||||
inline Standard_Integer AIS_PlaneTrihedron::Signature() const
|
||||
{return 4;}
|
||||
|
||||
|
||||
inline void AIS_PlaneTrihedron::SetXLabel(const TCollection_AsciiString& aLabel)
|
||||
{
|
||||
myXLabel = aLabel;
|
||||
}
|
||||
|
||||
|
||||
inline void AIS_PlaneTrihedron::SetYLabel(const TCollection_AsciiString& aLabel)
|
||||
{
|
||||
myYLabel = aLabel;
|
||||
}
|
@@ -14,9 +14,9 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AIS_Point.hxx>
|
||||
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Point.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <BRepBuilderAPI_MakeVertex.hxx>
|
||||
#include <Geom_Point.hxx>
|
||||
@@ -130,14 +130,8 @@ void AIS_Point::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Point::SetColor(const Quantity_NameOfColor aCol)
|
||||
{
|
||||
SetColor(Quantity_Color(aCol));
|
||||
}
|
||||
|
||||
void AIS_Point::SetColor (const Quantity_Color& theCol)
|
||||
{
|
||||
hasOwnColor=Standard_True;
|
||||
|
@@ -17,47 +17,29 @@
|
||||
#ifndef _AIS_Point_HeaderFile
|
||||
#define _AIS_Point_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Aspect_TypeOfMarker.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
|
||||
class Geom_Point;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class Quantity_Color;
|
||||
class TopoDS_Vertex;
|
||||
|
||||
|
||||
class AIS_Point;
|
||||
DEFINE_STANDARD_HANDLE(AIS_Point, AIS_InteractiveObject)
|
||||
|
||||
//! Constructs point datums to be used in construction of
|
||||
//! composite shapes. The datum is displayed as the plus marker +.
|
||||
class AIS_Point : public AIS_InteractiveObject
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Point, AIS_InteractiveObject)
|
||||
public:
|
||||
|
||||
|
||||
|
||||
//! Initializes the point aComponent from which the point
|
||||
//! datum will be built.
|
||||
Standard_EXPORT AIS_Point(const Handle(Geom_Point)& aComponent);
|
||||
|
||||
//! Returns index 1, the default index for a point.
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE;
|
||||
|
||||
virtual Standard_Integer Signature() const Standard_OVERRIDE { return 1; }
|
||||
|
||||
//! Indicates that a point is a datum.
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
|
||||
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
|
||||
|
||||
//! Returns the component specified in SetComponent.
|
||||
Standard_EXPORT Handle(Geom_Point) Component();
|
||||
|
||||
@@ -75,12 +57,10 @@ public:
|
||||
//! WARNING :<aTrsf> must be applied
|
||||
//! to the object to display before computation !!!
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Geom_Transformation)& aTrsf, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
//! Allows you to provide settings for the cp;pr aColor.
|
||||
Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
|
||||
|
||||
|
||||
//! Allows you to provide settings for the Color.
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
|
||||
|
||||
//! Allows you to remove color settings.
|
||||
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
|
||||
|
||||
@@ -94,44 +74,31 @@ public:
|
||||
Standard_EXPORT void UnsetMarker();
|
||||
|
||||
//! Returns true if the point datum has a marker.
|
||||
Standard_Boolean HasMarker() const;
|
||||
|
||||
Standard_Boolean HasMarker() const { return myHasTOM; }
|
||||
|
||||
//! Converts a point into a vertex.
|
||||
Standard_EXPORT TopoDS_Vertex Vertex() const;
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Point,AIS_InteractiveObject)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
|
||||
|
||||
Standard_EXPORT void ComputeSelection (const Handle(SelectMgr_Selection)& aSelection, const Standard_Integer aMode) Standard_OVERRIDE;
|
||||
|
||||
|
||||
Standard_EXPORT void UpdatePointValues();
|
||||
|
||||
private:
|
||||
|
||||
Handle(Geom_Point) myComponent;
|
||||
Standard_Boolean myHasTOM;
|
||||
Aspect_TypeOfMarker myTOM;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_Point.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Point, AIS_InteractiveObject)
|
||||
|
||||
#endif // _AIS_Point_HeaderFile
|
||||
|
@@ -1,25 +0,0 @@
|
||||
// Created on: 1997-03-06
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
inline AIS_KindOfInteractive AIS_Point::Type() const
|
||||
{return AIS_KOI_Datum;}
|
||||
|
||||
|
||||
inline Standard_Integer AIS_Point::Signature() const
|
||||
{return 1;}
|
||||
|
||||
inline Standard_Boolean AIS_Point::HasMarker() const
|
||||
{return myHasTOM;}
|
@@ -140,15 +140,6 @@ void AIS_PointCloud::SetPoints (const Handle(TColgp_HArray1OfPnt)& theCoords
|
||||
myBndBox = getBoundingBox (myPoints);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_PointCloud::SetColor (const Quantity_NameOfColor theColor)
|
||||
{
|
||||
SetColor (Quantity_Color (theColor));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
@@ -292,15 +283,6 @@ void AIS_PointCloud::UnsetColor()
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMaterial
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void AIS_PointCloud::SetMaterial (const Graphic3d_NameOfMaterial theMatName)
|
||||
{
|
||||
SetMaterial (Graphic3d_MaterialAspect (theMatName));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMaterial
|
||||
//purpose :
|
||||
|
@@ -93,18 +93,12 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
//! Setup custom color. Affects presentation only when no per-point color attribute has been assigned.
|
||||
Standard_EXPORT virtual void SetColor (const Quantity_NameOfColor theColor) Standard_OVERRIDE;
|
||||
|
||||
//! Setup custom color. Affects presentation only when no per-point color attribute has been assigned.
|
||||
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
|
||||
|
||||
//! Restore default color.
|
||||
Standard_EXPORT virtual void UnsetColor() Standard_OVERRIDE;
|
||||
|
||||
//! Setup custom material. Affects presentation only when normals are defined.
|
||||
Standard_EXPORT virtual void SetMaterial (const Graphic3d_NameOfMaterial theMatName) Standard_OVERRIDE;
|
||||
|
||||
//! Setup custom material. Affects presentation only when normals are defined.
|
||||
Standard_EXPORT virtual void SetMaterial (const Graphic3d_MaterialAspect& theMat) Standard_OVERRIDE;
|
||||
|
||||
|
@@ -208,12 +208,6 @@ void AIS_Relation::ComputeProjVertexPresentation(const Handle(Prs3d_Presentation
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Relation::SetColor(const Quantity_NameOfColor aCol)
|
||||
{
|
||||
SetColor(Quantity_Color(aCol));
|
||||
}
|
||||
|
||||
void AIS_Relation::SetColor(const Quantity_Color &aCol)
|
||||
{
|
||||
if(hasOwnColor && myDrawer->Color() == aCol) return;
|
||||
|
@@ -17,41 +17,26 @@
|
||||
#ifndef _AIS_Relation_HeaderFile
|
||||
#define _AIS_Relation_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <DsgPrs_ArrowSide.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <AIS_KindOfSurface.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <PrsMgr_TypeOfPresentation3d.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <AIS_KindOfDimension.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <AIS_KindOfSurface.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <Aspect_TypeOfMarker.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <DsgPrs_ArrowSide.hxx>
|
||||
#include <gp_Pln.hxx>
|
||||
#include <gp_Pnt.hxx>
|
||||
#include <PrsMgr_TypeOfPresentation3d.hxx>
|
||||
#include <TCollection_ExtendedString.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
|
||||
class Geom_Curve;
|
||||
class Geom_Plane;
|
||||
class Geom_Surface;
|
||||
class Quantity_Color;
|
||||
class TopoDS_Shape;
|
||||
class gp_Pnt;
|
||||
class TCollection_ExtendedString;
|
||||
class Prs3d_Presentation;
|
||||
class TopoDS_Edge;
|
||||
class Geom_Curve;
|
||||
class TopoDS_Vertex;
|
||||
|
||||
|
||||
class AIS_Relation;
|
||||
DEFINE_STANDARD_HANDLE(AIS_Relation, AIS_InteractiveObject)
|
||||
|
||||
//! One of the four types of interactive object in
|
||||
//! AIS,comprising dimensions and constraints. Serves
|
||||
//! as the abstract class for the seven relation classes as
|
||||
@@ -63,82 +48,86 @@ DEFINE_STANDARD_HANDLE(AIS_Relation, AIS_InteractiveObject)
|
||||
//! The connection takes the form of an edge between the two shapes.
|
||||
class AIS_Relation : public AIS_InteractiveObject
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Relation, AIS_InteractiveObject)
|
||||
public:
|
||||
|
||||
|
||||
//! Allows you to provide settings for the color aColor
|
||||
//! Allows you to provide settings for the color theColor
|
||||
//! of the lines representing the relation between the two shapes.
|
||||
Standard_EXPORT void SetColor (const Quantity_NameOfColor aColor) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
|
||||
|
||||
//! Allows you to remove settings for the color of the
|
||||
//! lines representing the relation between the two shapes.
|
||||
Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
|
||||
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
|
||||
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Relation; }
|
||||
|
||||
//! Indicates that the type of dimension is unknown.
|
||||
Standard_EXPORT virtual AIS_KindOfDimension KindOfDimension() const;
|
||||
|
||||
//! Returns true if the interactive object is movable.
|
||||
Standard_EXPORT virtual Standard_Boolean IsMovable() const;
|
||||
|
||||
const TopoDS_Shape& FirstShape() const;
|
||||
|
||||
|
||||
const TopoDS_Shape& FirstShape() const { return myFShape; }
|
||||
|
||||
Standard_EXPORT virtual void SetFirstShape (const TopoDS_Shape& aFShape);
|
||||
|
||||
|
||||
//! Returns the second shape.
|
||||
const TopoDS_Shape& SecondShape() const;
|
||||
|
||||
const TopoDS_Shape& SecondShape() const { return mySShape; }
|
||||
|
||||
//! Allows you to identify the second shape aSShape
|
||||
//! relative to the first.
|
||||
Standard_EXPORT virtual void SetSecondShape (const TopoDS_Shape& aSShape);
|
||||
|
||||
void SetBndBox (const Standard_Real Xmin, const Standard_Real Ymin, const Standard_Real Zmin, const Standard_Real Xmax, const Standard_Real Ymax, const Standard_Real Zmax);
|
||||
|
||||
void UnsetBndBox();
|
||||
|
||||
//! Returns the plane.
|
||||
const Handle(Geom_Plane)& Plane() const;
|
||||
|
||||
|
||||
//! Allows you to set the plane aPlane. This is used to
|
||||
void SetBndBox (const Standard_Real theXmin, const Standard_Real theYmin, const Standard_Real theZmin,
|
||||
const Standard_Real theXmax, const Standard_Real theYmax, const Standard_Real theZmax)
|
||||
{
|
||||
myBndBox.Update (theXmin, theYmin, theZmin, theXmax, theYmax, theZmax);
|
||||
myIsSetBndBox = Standard_True;
|
||||
}
|
||||
|
||||
void UnsetBndBox() { myIsSetBndBox = Standard_False; }
|
||||
|
||||
//! Returns the plane.
|
||||
const Handle(Geom_Plane)& Plane() const { return myPlane; }
|
||||
|
||||
//! Allows you to set the plane thePlane. This is used to
|
||||
//! define relations and dimensions in several daughter classes.
|
||||
void SetPlane (const Handle(Geom_Plane)& aPlane);
|
||||
|
||||
void SetPlane (const Handle(Geom_Plane)& thePlane) { myPlane = thePlane; }
|
||||
|
||||
//! Returns the value of each object in the relation.
|
||||
Standard_Real Value() const;
|
||||
|
||||
//! Allows you to provide settings for the value aVal for
|
||||
//! each object in the relation.
|
||||
void SetValue (const Standard_Real aVal);
|
||||
|
||||
Standard_Real Value() const { return myVal; }
|
||||
|
||||
//! Allows you to provide settings for the value theVal for each object in the relation.
|
||||
void SetValue (const Standard_Real theVal) { myVal = theVal; }
|
||||
|
||||
//! Returns the position set using SetPosition.
|
||||
const gp_Pnt& Position() const;
|
||||
|
||||
const gp_Pnt& Position() const { return myPosition; }
|
||||
|
||||
//! Allows you to provide the objects in the relation with
|
||||
//! settings for a non-default position.
|
||||
void SetPosition (const gp_Pnt& aPosition);
|
||||
|
||||
void SetPosition (const gp_Pnt& thePosition)
|
||||
{
|
||||
myPosition = thePosition;
|
||||
myAutomaticPosition = Standard_False;
|
||||
}
|
||||
|
||||
//! Returns settings for text aspect.
|
||||
const TCollection_ExtendedString& Text() const;
|
||||
|
||||
//! Allows you to provide the settings aText for text aspect.
|
||||
void SetText (const TCollection_ExtendedString& aText);
|
||||
|
||||
const TCollection_ExtendedString& Text() const { return myText; }
|
||||
|
||||
//! Allows you to provide the settings theText for text aspect.
|
||||
void SetText (const TCollection_ExtendedString& theText) { myText = theText; }
|
||||
|
||||
//! Returns the value for the size of the arrow identifying
|
||||
//! the relation between the two shapes.
|
||||
Standard_Real ArrowSize() const;
|
||||
|
||||
Standard_Real ArrowSize() const { return myArrowSize; }
|
||||
|
||||
//! Allows you to provide settings for the size of the
|
||||
//! arrow anArrowsize identifying the relation between the two shapes.
|
||||
void SetArrowSize (const Standard_Real anArrowSize);
|
||||
|
||||
//! arrow theArrowSize identifying the relation between the two shapes.
|
||||
void SetArrowSize (const Standard_Real theArrowSize)
|
||||
{
|
||||
myArrowSize = theArrowSize;
|
||||
myArrowSizeIsDefined = Standard_True;
|
||||
}
|
||||
|
||||
//! Returns the value of the symbol presentation. This will be one of:
|
||||
//! - AS_NONE - none
|
||||
@@ -150,12 +139,10 @@ public:
|
||||
//! - AS_BOTHPT - both points
|
||||
//! - AS_FIRSTAR_LASTPT - first arrow, last point
|
||||
//! - AS_FIRSTPT_LASTAR - first point, last arrow
|
||||
DsgPrs_ArrowSide SymbolPrs() const;
|
||||
|
||||
DsgPrs_ArrowSide SymbolPrs() const { return mySymbolPrs; }
|
||||
|
||||
//! Allows you to provide settings for the symbol presentation.
|
||||
void SetSymbolPrs (const DsgPrs_ArrowSide aSymbolPrs);
|
||||
|
||||
void SetSymbolPrs (const DsgPrs_ArrowSide theSymbolPrs) { mySymbolPrs = theSymbolPrs; }
|
||||
|
||||
//! Allows you to set the status of the extension shape by
|
||||
//! the index aIndex.
|
||||
@@ -163,12 +150,10 @@ public:
|
||||
//! - 0 - there is no connection to a shape;
|
||||
//! - 1 - there is a connection to the first shape;
|
||||
//! - 2 - there is a connection to the second shape.
|
||||
void SetExtShape (const Standard_Integer aIndex);
|
||||
|
||||
void SetExtShape (const Standard_Integer theIndex) { myExtShape = theIndex; }
|
||||
|
||||
//! Returns the status index of the extension shape.
|
||||
Standard_Integer ExtShape() const;
|
||||
|
||||
Standard_Integer ExtShape() const { return myExtShape; }
|
||||
|
||||
//! Returns true if the display mode aMode is accepted
|
||||
//! for the Interactive Objects in the relation.
|
||||
@@ -185,34 +170,30 @@ public:
|
||||
//! aProjTOL : TypeOfLine from Aspect = Aspect_TOL_DASH;
|
||||
//! aCallTOL : TypeOfLine from Aspect = Aspect_TOL_DOT)
|
||||
Standard_EXPORT virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer aMode) const Standard_OVERRIDE;
|
||||
|
||||
void SetAutomaticPosition (const Standard_Boolean aStatus);
|
||||
|
||||
Standard_Boolean AutomaticPosition() const;
|
||||
|
||||
void SetAutomaticPosition (const Standard_Boolean theStatus) { myAutomaticPosition = theStatus; }
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Relation,AIS_InteractiveObject)
|
||||
Standard_Boolean AutomaticPosition() const { return myAutomaticPosition; }
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT AIS_Relation(const PrsMgr_TypeOfPresentation3d aTypeOfPresentation3d = PrsMgr_TOP_AllView);
|
||||
|
||||
|
||||
//! Calculates the presentation aPres of the the edge
|
||||
//! anEdge and the curve it defines, ProjCurve. The later
|
||||
//! is also specified by the first point FirstP and the last point LastP.
|
||||
//! The presentation includes settings for color aColor,
|
||||
//! type - aProjTOL and aCallTOL - and width of line, aWidth.
|
||||
Standard_EXPORT void ComputeProjEdgePresentation (const Handle(Prs3d_Presentation)& aPres, const TopoDS_Edge& anEdge, const Handle(Geom_Curve)& ProjCurve, const gp_Pnt& FirstP, const gp_Pnt& LastP, const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE, const Standard_Real aWidth = 2, const Aspect_TypeOfLine aProjTOL = Aspect_TOL_DASH, const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT) const;
|
||||
|
||||
|
||||
//! Calculates the presentation aPres of the the vertex
|
||||
//! aVertex and the point it defines, ProjPoint.
|
||||
//! The presentation includes settings for color aColor,
|
||||
//! type - aProjTOM and aCallTOL - and width of line, aWidth.
|
||||
Standard_EXPORT void ComputeProjVertexPresentation (const Handle(Prs3d_Presentation)& aPres, const TopoDS_Vertex& aVertex, const gp_Pnt& ProjPoint, const Quantity_NameOfColor aColor = Quantity_NOC_PURPLE, const Standard_Real aWidth = 2, const Aspect_TypeOfMarker aProjTOM = Aspect_TOM_PLUS, const Aspect_TypeOfLine aCallTOL = Aspect_TOL_DOT) const;
|
||||
|
||||
protected:
|
||||
|
||||
TopoDS_Shape myFShape;
|
||||
TopoDS_Shape mySShape;
|
||||
Handle(Geom_Plane) myPlane;
|
||||
@@ -235,19 +216,8 @@ protected:
|
||||
Standard_Boolean myIsSetBndBox;
|
||||
Standard_Boolean myArrowSizeIsDefined;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_Relation.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Relation, AIS_InteractiveObject)
|
||||
|
||||
#endif // _AIS_Relation_HeaderFile
|
||||
|
@@ -1,224 +0,0 @@
|
||||
// Created on: 1996-12-05
|
||||
// Created by: Odile Olivier
|
||||
// Copyright (c) 1996-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const TopoDS_Shape& AIS_Relation::FirstShape() const
|
||||
{
|
||||
return myFShape;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SecondShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const TopoDS_Shape& AIS_Relation::SecondShape() const
|
||||
{
|
||||
return mySShape;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetBndBox
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void AIS_Relation::SetBndBox( const Standard_Real Xmin,
|
||||
const Standard_Real Ymin,
|
||||
const Standard_Real Zmin,
|
||||
const Standard_Real Xmax,
|
||||
const Standard_Real Ymax,
|
||||
const Standard_Real Zmax )
|
||||
{
|
||||
myBndBox.Update( Xmin, Ymin, Zmin, Xmax, Ymax, Zmax );
|
||||
myIsSetBndBox = Standard_True;
|
||||
}
|
||||
|
||||
inline void AIS_Relation::UnsetBndBox()
|
||||
{
|
||||
myIsSetBndBox = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : :Plane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const Handle(Geom_Plane)& AIS_Relation::Plane() const
|
||||
{
|
||||
return myPlane;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPlane
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void AIS_Relation::SetPlane(const Handle(Geom_Plane)& aPlane)
|
||||
{
|
||||
myPlane = aPlane;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real AIS_Relation::Value() const
|
||||
{
|
||||
return myVal;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetValue
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void AIS_Relation::SetValue(const Standard_Real aVal)
|
||||
{
|
||||
myVal = aVal;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Position
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const gp_Pnt& AIS_Relation::Position() const
|
||||
{
|
||||
return myPosition;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetPosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void AIS_Relation::SetPosition(const gp_Pnt& aPosition)
|
||||
{
|
||||
myPosition = aPosition;
|
||||
myAutomaticPosition = Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Text
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline const TCollection_ExtendedString& AIS_Relation::Text() const
|
||||
{
|
||||
return myText;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetText
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void AIS_Relation::SetText(const TCollection_ExtendedString& aText)
|
||||
{
|
||||
myText = aText;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : ArrowSize
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real AIS_Relation::ArrowSize() const
|
||||
{
|
||||
return myArrowSize;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetArrowSize
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void AIS_Relation::SetArrowSize(const Standard_Real anArrowSize)
|
||||
{
|
||||
myArrowSize = anArrowSize;
|
||||
myArrowSizeIsDefined = Standard_True;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SymbolPrs
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline DsgPrs_ArrowSide AIS_Relation::SymbolPrs() const
|
||||
{
|
||||
return mySymbolPrs;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetSymbolPrs
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline void AIS_Relation::SetSymbolPrs(const DsgPrs_ArrowSide aSymbolPrs)
|
||||
{
|
||||
mySymbolPrs = aSymbolPrs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : KindOfInteractive
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline AIS_KindOfInteractive AIS_Relation::Type() const
|
||||
{return AIS_KOI_Relation;}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetExtShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline void AIS_Relation::SetExtShape(const Standard_Integer ExtSh)
|
||||
{myExtShape = ExtSh;}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : ExtShape
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Integer AIS_Relation::ExtShape() const
|
||||
{return myExtShape;}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : SetAutomaticPosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline void AIS_Relation::SetAutomaticPosition ( const Standard_Boolean aStatus )
|
||||
{
|
||||
myAutomaticPosition = aStatus ;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : AutomaticPosition
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Boolean AIS_Relation::AutomaticPosition () const
|
||||
{
|
||||
return myAutomaticPosition;
|
||||
}
|
@@ -14,10 +14,10 @@
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <AIS_Shape.hxx>
|
||||
|
||||
#include <AIS_GraphicTool.hxx>
|
||||
#include <AIS_InteractiveContext.hxx>
|
||||
#include <AIS_Shape.hxx>
|
||||
#include <Aspect_TypeOfLine.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <BRep_Builder.hxx>
|
||||
@@ -411,12 +411,6 @@ void AIS_Shape::ComputeSelection(const Handle(SelectMgr_Selection)& aSelection,
|
||||
StdSelect::SetDrawerForBRepOwner(aSelection,myDrawer);
|
||||
}
|
||||
|
||||
Quantity_NameOfColor AIS_Shape::Color() const {
|
||||
Quantity_Color aColor;
|
||||
Color(aColor);
|
||||
return aColor.Name();
|
||||
}
|
||||
|
||||
void AIS_Shape::Color( Quantity_Color& aColor ) const {
|
||||
aColor = myDrawer->ShadingAspect()->Color(myCurrentFacingModel);
|
||||
}
|
||||
@@ -429,16 +423,6 @@ Standard_Real AIS_Shape::Transparency() const {
|
||||
return myDrawer->ShadingAspect()->Transparency(myCurrentFacingModel);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetColor
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::SetColor(const Quantity_NameOfColor aCol)
|
||||
{
|
||||
SetColor(Quantity_Color(aCol));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : setColor
|
||||
//purpose :
|
||||
@@ -830,16 +814,6 @@ void AIS_Shape::setMaterial (const Handle(Prs3d_Drawer)& theDrawer,
|
||||
}
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMaterial
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void AIS_Shape::SetMaterial(const Graphic3d_NameOfMaterial aMat)
|
||||
{
|
||||
SetMaterial(Graphic3d_MaterialAspect(aMat));
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : SetMaterial
|
||||
//purpose :
|
||||
|
@@ -17,35 +17,16 @@
|
||||
#ifndef _AIS_Shape_HeaderFile
|
||||
#define _AIS_Shape_HeaderFile
|
||||
|
||||
#include <Standard.hxx>
|
||||
#include <Standard_Type.hxx>
|
||||
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <Standard_Boolean.hxx>
|
||||
#include <Standard_Real.hxx>
|
||||
#include <AIS_InteractiveObject.hxx>
|
||||
#include <Standard_Integer.hxx>
|
||||
#include <AIS_KindOfInteractive.hxx>
|
||||
#include <Prs3d_TypeOfHLR.hxx>
|
||||
#include <PrsMgr_PresentationManager3d.hxx>
|
||||
#include <SelectMgr_Selection.hxx>
|
||||
#include <Quantity_NameOfColor.hxx>
|
||||
#include <Graphic3d_NameOfMaterial.hxx>
|
||||
#include <Bnd_Box.hxx>
|
||||
#include <TopAbs_ShapeEnum.hxx>
|
||||
#include <TopoDS_Shape.hxx>
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
#include <Prs3d_TypeOfHLR.hxx>
|
||||
|
||||
class TopoDS_Shape;
|
||||
class Prs3d_Presentation;
|
||||
class Prs3d_Projector;
|
||||
class Geom_Transformation;
|
||||
class Quantity_Color;
|
||||
class Graphic3d_MaterialAspect;
|
||||
class Bnd_Box;
|
||||
|
||||
|
||||
class AIS_Shape;
|
||||
DEFINE_STANDARD_HANDLE(AIS_Shape, AIS_InteractiveObject)
|
||||
|
||||
//! A framework to manage presentation and selection of shapes.
|
||||
//! AIS_Shape is the interactive object which is used the
|
||||
//! most by applications. There are standard functions
|
||||
@@ -70,10 +51,9 @@ DEFINE_STANDARD_HANDLE(AIS_Shape, AIS_InteractiveObject)
|
||||
//! for the specific object.
|
||||
class AIS_Shape : public AIS_InteractiveObject
|
||||
{
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Shape, AIS_InteractiveObject)
|
||||
public:
|
||||
|
||||
|
||||
//! Initializes construction of the shape shap from wires,
|
||||
//! edges and vertices.
|
||||
Standard_EXPORT AIS_Shape(const TopoDS_Shape& shap);
|
||||
@@ -87,12 +67,16 @@ public:
|
||||
//! Returns true if the Interactive Object accepts shape decomposition.
|
||||
Standard_EXPORT virtual Standard_Boolean AcceptShapeDecomposition() const Standard_OVERRIDE;
|
||||
|
||||
//! Constructs an instance of the shape object ashape.
|
||||
void Set (const TopoDS_Shape& ashap);
|
||||
|
||||
//! Constructs an instance of the shape object theShape.
|
||||
void Set (const TopoDS_Shape& theShape)
|
||||
{
|
||||
myshape = theShape;
|
||||
myCompBB = Standard_True;
|
||||
}
|
||||
|
||||
//! Returns this shape object.
|
||||
const TopoDS_Shape& Shape() const;
|
||||
|
||||
const TopoDS_Shape& Shape() const { return myshape; }
|
||||
|
||||
//! Sets a local value for deviation coefficient for this specific shape.
|
||||
Standard_EXPORT Standard_Boolean SetOwnDeviationCoefficient();
|
||||
|
||||
@@ -153,11 +137,11 @@ public:
|
||||
Standard_EXPORT Standard_Boolean OwnHLRDeviationAngle (Standard_Real& anAngle, Standard_Real& aPreviousAngle) const;
|
||||
|
||||
//! Sets the type of HLR algorithm used by the shape
|
||||
void SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR);
|
||||
|
||||
void SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR) { myDrawer->SetTypeOfHLR (theTypeOfHLR); }
|
||||
|
||||
//! Gets the type of HLR algorithm
|
||||
Prs3d_TypeOfHLR TypeOfHLR() const;
|
||||
|
||||
Prs3d_TypeOfHLR TypeOfHLR() const { return myDrawer->TypeOfHLR(); }
|
||||
|
||||
//! Sets the color aColor in the reconstructed
|
||||
//! compound shape. Acts via the Drawer methods below on the appearance of:
|
||||
//! - free boundaries:
|
||||
@@ -171,10 +155,8 @@ public:
|
||||
//! Prs3d_Drawer_SeenLineAspect
|
||||
//! - hidden line color in hidden line mode:
|
||||
//! Prs3d_Drawer_HiddenLineAspect.
|
||||
Standard_EXPORT virtual void SetColor (const Quantity_NameOfColor aColor) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
|
||||
|
||||
//! Removes settings for color in the reconstructed compound shape.
|
||||
Standard_EXPORT virtual void UnsetColor() Standard_OVERRIDE;
|
||||
|
||||
@@ -185,9 +167,7 @@ public:
|
||||
|
||||
//! Removes the setting for line width in the reconstructed compound shape.
|
||||
Standard_EXPORT virtual void UnsetWidth() Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void SetMaterial (const Graphic3d_NameOfMaterial aName) Standard_OVERRIDE;
|
||||
|
||||
|
||||
//! Allows you to provide settings for the material aName
|
||||
//! in the reconstructed compound shape.
|
||||
Standard_EXPORT virtual void SetMaterial (const Graphic3d_MaterialAspect& aName) Standard_OVERRIDE;
|
||||
@@ -209,10 +189,6 @@ public:
|
||||
//! which is not the same as above; keep it visible.
|
||||
using AIS_InteractiveObject::BoundingBox;
|
||||
|
||||
//! Returns the NameOfColor attributes of the shape accordingly to
|
||||
//! the current facing model;
|
||||
Standard_EXPORT virtual Quantity_NameOfColor Color() const Standard_OVERRIDE;
|
||||
|
||||
//! Returns the Color attributes of the shape accordingly to
|
||||
//! the current facing model;
|
||||
Standard_EXPORT virtual void Color (Quantity_Color& aColor) const Standard_OVERRIDE;
|
||||
@@ -242,14 +218,8 @@ public:
|
||||
//! - mode 8 - Compound
|
||||
Standard_EXPORT static Standard_Integer SelectionMode (const TopAbs_ShapeEnum aShapeType);
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_RTTIEXT(AIS_Shape,AIS_InteractiveObject)
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager, const Handle(Prs3d_Presentation)& aPresentation, const Standard_Integer aMode = 0) Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation) Standard_OVERRIDE;
|
||||
@@ -268,26 +238,22 @@ protected:
|
||||
|
||||
Standard_EXPORT void setMaterial (const Handle(Prs3d_Drawer)& theDrawer, const Graphic3d_MaterialAspect& theMaterial, const Standard_Boolean theToKeepColor, const Standard_Boolean theToKeepTransp) const;
|
||||
|
||||
protected:
|
||||
|
||||
TopoDS_Shape myshape;
|
||||
Bnd_Box myBB;
|
||||
Standard_Boolean myCompBB;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void Compute (const Handle(Prs3d_Projector)& aProjector, const Handle(Prs3d_Presentation)& aPresentation, const TopoDS_Shape& ashape);
|
||||
|
||||
Standard_Real myInitAng;
|
||||
private:
|
||||
|
||||
Standard_Real myInitAng;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#include <AIS_Shape.lxx>
|
||||
|
||||
|
||||
|
||||
|
||||
DEFINE_STANDARD_HANDLE(AIS_Shape, AIS_InteractiveObject)
|
||||
|
||||
#endif // _AIS_Shape_HeaderFile
|
||||
|
@@ -1,39 +0,0 @@
|
||||
// Created on: 1997-01-08
|
||||
// Created by: Robert COUBLANC
|
||||
// Copyright (c) 1997-1999 Matra Datavision
|
||||
// Copyright (c) 1999-2014 OPEN CASCADE SAS
|
||||
//
|
||||
// This file is part of Open CASCADE Technology software library.
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify it under
|
||||
// the terms of the GNU Lesser General Public License version 2.1 as published
|
||||
// by the Free Software Foundation, with special exception defined in the file
|
||||
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
|
||||
// distribution for complete text of the license and disclaimer of any warranty.
|
||||
//
|
||||
// Alternatively, this file may be used under the terms of Open CASCADE
|
||||
// commercial license or contractual agreement.
|
||||
|
||||
#include <Prs3d_Drawer.hxx>
|
||||
|
||||
inline void AIS_Shape::Set(const TopoDS_Shape& ashap)
|
||||
{
|
||||
myshape = ashap;
|
||||
myCompBB = Standard_True;
|
||||
}
|
||||
|
||||
inline const TopoDS_Shape&
|
||||
AIS_Shape::Shape() const
|
||||
{
|
||||
return myshape;
|
||||
}
|
||||
|
||||
inline void AIS_Shape::SetTypeOfHLR (const Prs3d_TypeOfHLR theTypeOfHLR)
|
||||
{
|
||||
myDrawer->SetTypeOfHLR (theTypeOfHLR);
|
||||
}
|
||||
|
||||
inline Prs3d_TypeOfHLR AIS_Shape::TypeOfHLR ( ) const
|
||||
{
|
||||
return myDrawer->TypeOfHLR();
|
||||
}
|
@@ -35,18 +35,12 @@ public:
|
||||
//! Setup color of entire text.
|
||||
Standard_EXPORT virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
|
||||
|
||||
//! Setup color of entire text.
|
||||
virtual void SetColor (const Quantity_NameOfColor theColor) Standard_OVERRIDE { SetColor (Quantity_Color (theColor)); }
|
||||
|
||||
//! Setup transparency within [0, 1] range.
|
||||
Standard_EXPORT virtual void SetTransparency (const Standard_Real theValue) Standard_OVERRIDE;
|
||||
|
||||
//! Removes the transparency setting.
|
||||
virtual void UnsetTransparency() Standard_OVERRIDE { SetTransparency (0.0); }
|
||||
|
||||
//! Material has no effect for text label.
|
||||
virtual void SetMaterial (const Graphic3d_NameOfMaterial ) Standard_OVERRIDE {}
|
||||
|
||||
//! Material has no effect for text label.
|
||||
virtual void SetMaterial (const Graphic3d_MaterialAspect& ) Standard_OVERRIDE {}
|
||||
|
||||
|
@@ -104,12 +104,6 @@ public:
|
||||
//! Indicates that the type of Interactive Object is datum.
|
||||
virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
|
||||
|
||||
//! Sets the color theColor for this trihedron object, it changes color of axes.
|
||||
void SetColor (const Quantity_NameOfColor theColor) Standard_OVERRIDE
|
||||
{
|
||||
return SetColor (Quantity_Color (theColor));
|
||||
}
|
||||
|
||||
//! Sets the color theColor for this trihedron object, it changes color of axes.
|
||||
Standard_EXPORT void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
|
||||
|
||||
|
@@ -15,7 +15,6 @@ AIS_AttributeFilter.hxx
|
||||
AIS_AttributeFilter.lxx
|
||||
AIS_Axis.cxx
|
||||
AIS_Axis.hxx
|
||||
AIS_Axis.lxx
|
||||
AIS_BadEdgeFilter.cxx
|
||||
AIS_BadEdgeFilter.hxx
|
||||
AIS_C0RegularityFilter.cxx
|
||||
@@ -28,7 +27,6 @@ AIS_Chamf3dDimension.hxx
|
||||
AIS_Chamf3dDimension.lxx
|
||||
AIS_Circle.cxx
|
||||
AIS_Circle.hxx
|
||||
AIS_Circle.lxx
|
||||
AIS_ClearMode.hxx
|
||||
AIS_ColoredDrawer.hxx
|
||||
AIS_ColoredShape.cxx
|
||||
@@ -96,7 +94,6 @@ AIS_LengthDimension.cxx
|
||||
AIS_LengthDimension.hxx
|
||||
AIS_Line.cxx
|
||||
AIS_Line.hxx
|
||||
AIS_Line.lxx
|
||||
AIS_ListIteratorOfListOfInteractive.hxx
|
||||
AIS_ListOfInteractive.hxx
|
||||
AIS_LocalContext.cxx
|
||||
@@ -134,20 +131,16 @@ AIS_PerpendicularRelation.cxx
|
||||
AIS_PerpendicularRelation.hxx
|
||||
AIS_Plane.cxx
|
||||
AIS_Plane.hxx
|
||||
AIS_Plane.lxx
|
||||
AIS_PlaneTrihedron.cxx
|
||||
AIS_PlaneTrihedron.hxx
|
||||
AIS_PlaneTrihedron.lxx
|
||||
AIS_Point.cxx
|
||||
AIS_Point.hxx
|
||||
AIS_Point.lxx
|
||||
AIS_PointCloud.cxx
|
||||
AIS_PointCloud.hxx
|
||||
AIS_RadiusDimension.cxx
|
||||
AIS_RadiusDimension.hxx
|
||||
AIS_Relation.cxx
|
||||
AIS_Relation.hxx
|
||||
AIS_Relation.lxx
|
||||
AIS_RubberBand.hxx
|
||||
AIS_RubberBand.cxx
|
||||
AIS_Selection.cxx
|
||||
@@ -157,7 +150,6 @@ AIS_SequenceOfDimension.hxx
|
||||
AIS_SequenceOfInteractive.hxx
|
||||
AIS_Shape.cxx
|
||||
AIS_Shape.hxx
|
||||
AIS_Shape.lxx
|
||||
AIS_SignatureFilter.cxx
|
||||
AIS_SignatureFilter.hxx
|
||||
AIS_StandardDatum.hxx
|
||||
|
Reference in New Issue
Block a user