ActivateGrid, DeactivateGrid, SetRectangularGridValues, SetCircularGridValues,
RectangularGridGraphicValues, CircularGridGraphicValues, SetPrivilegedPlane, DisplayPrivilegedPlane.
+@subsection upgrade_720_v3d_colorname Elimination of Quantity_NameOfColor from TKV3d interface classes
+
+The duplicating interface methods accepting *Quantity_NameOfColor* (in addition to methods accepting *Quantity_Color*) of TKV3d toolkit have been removed.
+In most cases this change should be transparent, however applications implementing such interface methods should also remove them
+(compiler will automatically highlight this issue for methods marked with Standard_OVERRIDE keyword).
+
@subsection upgrade_720_Result_Of_BOP_On_Containers Result of Boolean operations on containers
* The result of Boolean operations on arguments of collection types (WIRE/SHELL/COMPSOLID) is now filtered from duplicating containers.
Quantity_Color aCol = Quantity_Color(theR/255.,theG/255.,theB/255.,Quantity_TOC_RGB);
for (; myAISContext()->MoreSelected(); myAISContext()->NextSelected())
{
- myAISContext()->SetColor (myAISContext()->SelectedInteractive(), aCol.Name(), Standard_False);
+ myAISContext()->SetColor (myAISContext()->SelectedInteractive(), aCol, Standard_False);
}
myAISContext()->UpdateCurrentViewer();
}
theGreen=255;
theBlue=255;
Handle(AIS_InteractiveObject) aCurrent ;
- Quantity_Color anObjCol;
myAISContext()->InitSelected();
if (!myAISContext()->MoreSelected())
{
aCurrent = myAISContext()->SelectedInteractive();
if ( aCurrent->HasColor () )
{
- anObjCol = myAISContext()->Color(aCurrent);
+ Quantity_Color anObjCol;
+ myAISContext()->Color (aCurrent, anObjCol);
Quantity_Parameter r1, r2, r3;
anObjCol.Values(r1, r2, r3, Quantity_TOC_RGB);
theRed=(int)r1*255;
Quantity_Color aCol (theR / 255.0, theG / 255.0, theB / 255.0, Quantity_TOC_RGB);
for (; myAISContext()->MoreSelected(); myAISContext()->NextSelected())
{
- myAISContext()->SetColor (myAISContext()->SelectedInteractive(), aCol.Name(), false);
+ myAISContext()->SetColor (myAISContext()->SelectedInteractive(), aCol, false);
}
myAISContext()->UpdateCurrentViewer();
}
Handle(AIS_InteractiveObject) aCurrent = myAISContext()->SelectedInteractive();
if (aCurrent->HasColor())
{
- Quantity_Color anObjCol = myAISContext()->Color (aCurrent);
+ Quantity_Color anObjCol;
+ myAISContext()->Color (aCurrent, anObjCol);
theRed = int(anObjCol.Red() * 255.0);
theGreen = int(anObjCol.Green() * 255.0);
theBlue = int(anObjCol.Blue() * 255.0);
Handle(AIS_InteractiveObject) Current = myAISContext->SelectedInteractive();
if (Current->HasColor())
{
- CSFColor = myAISContext->Color (Current);
+ myAISContext->Color (Current, CSFColor);
MSColor = RGB (CSFColor.Red()*255.0, CSFColor.Green()*255.0, CSFColor.Blue()*255.0);
}
else
Quantity_TOC_RGB);
Handle(AIS_InteractiveObject) aSelectedObject = myAISContext->SelectedInteractive();
- Handle(User_Cylinder)::DownCast (aSelectedObject)->SetColor (CSFColor.Name());
+ Handle(User_Cylinder)::DownCast (aSelectedObject)->SetColor (CSFColor);
myAISContext->Redisplay (aSelectedObject, Standard_True);
myState = -1;
}
myCResultDialog.SetTitle("Change face color");
- myCResultDialog.SetText(" TopoDS_Shape S = myAISContext->SelectedShape(); \n"
- " \n"
- " Handle(Geom_Surface) Surface = BRep_Tool::Surface(TopoDS::Face(S));"
- " if (Surface->IsKind(STANDARD_TYPE(Geom_Plane))) \n"
- " Handle(User_Cylinder)::DownCast(myAISContext->Current())->SetPlanarFaceColor(CSFColor.Name()); \n"
- " else \n"
- " Handle(User_Cylinder)::DownCast(myAISContext->Current())->SetCylindricalFaceColor(CSFColor.Name()); \n"
- " \n"
- " myAISContext->Redisplay(myAISContext->Current()); \n"
- " \n"
- " myAISContext->CloseLocalContext(); \n"
+ myCResultDialog.SetText( " Handle(AIS_InteractiveObject) aSelectedObject = myAISContext->SelectedInteractive(); \n"
+ " Handle(User_Cylinder)::DownCast(aSelectedObject)->SetColor (CSFColor); \n"
+ " myAISContext->Redisplay (myAISContext->Current(), Standard_True); \n"
" \n"
" \n"
" NOTE: a User_Cylinder is an object defined by the user. \n"
" The User_Cylinder class inherit from the AIS_InteractiveObject \n"
" Cascade class, it's use is the same as an AIS_InteractiveObject. \n"
- " Methods SetPlanarFaceColor and SetCylindricalFaceColor are also \n"
- " defined in the User_Cylinder class. \n"
" \n");
SetTitle (L"Change face color");
}
{
Handle(AIS_InteractiveObject) Current ;
COLORREF MSColor ;
- Quantity_Color CSFColor ;
myAISContext->InitSelected();
Current = myAISContext->SelectedInteractive();
if ( Current->HasColor () ) {
- CSFColor = myAISContext->Color(Current);
+ Quantity_Color CSFColor;
+ myAISContext->Color (Current, CSFColor);
MSColor = RGB (CSFColor.Red()*255.,CSFColor.Green()*255.,CSFColor.Blue()*255.);
}
else {
if (dlgColor.DoModal() == IDOK)
{
MSColor = dlgColor.GetColor();
- CSFColor = Quantity_Color (GetRValue(MSColor)/255.,GetGValue(MSColor)/255.,
- GetBValue(MSColor)/255.,Quantity_TOC_RGB);
+ Quantity_Color CSFColor (GetRValue(MSColor)/255., GetGValue(MSColor)/255., GetBValue(MSColor)/255., Quantity_TOC_RGB);
for (;myAISContext->MoreSelected ();myAISContext->NextSelected ())
- myAISContext->SetColor (myAISContext->SelectedInteractive(),CSFColor.Name(), Standard_False);
+ myAISContext->SetColor (myAISContext->SelectedInteractive(), CSFColor, Standard_False);
myAISContext->UpdateCurrentViewer();
}
}
void DocumentCommon::onColor()
{
QColor aColor ;
- Quantity_Color aShapeColor;
myContext->InitSelected();
Handle(AIS_InteractiveObject) Current = myContext->SelectedInteractive() ;
if ( Current->HasColor () )
{
- aShapeColor = myContext->Color( Current );
+ Quantity_Color aShapeColor;
+ myContext->Color( Current, aShapeColor );
aColor.setRgb( aShapeColor.Red() * 255, aShapeColor.Green() * 255, aShapeColor.Blue() * 255 );
}
else
Quantity_Color color( aRetColor.red() / 255., aRetColor.green() / 255.,
aRetColor.blue() / 255., Quantity_TOC_RGB );
for (; myContext->MoreSelected(); myContext->NextSelected() )
- myContext->SetColor( myContext->SelectedInteractive(), color.Name(), Standard_False);
+ myContext->SetColor( myContext->SelectedInteractive(), color, Standard_False);
myContext->UpdateCurrentViewer();
}
}
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;
// 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>
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);
//=======================================================================
//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;
#ifndef _AIS_Axis_HeaderFile
#define _AIS_Axis_HeaderFile
-#include <Standard.hxx>
-#include <Standard_Type.hxx>
-
-#include <gp_Pnt.hxx>
+#include <AIS_InteractiveObject.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 <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
//! 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
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;
//! 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;
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;
Standard_EXPORT void ComputeFields();
+private:
+
Handle(Geom_Line) myComponent;
Handle(Geom_Axis2Placement) myAx2;
gp_Pnt myPfirst;
Standard_CString myText;
Handle(Prs3d_LineAspect) myLineAspect;
-
};
-
-#include <AIS_Axis.lxx>
-
-
-
-
+DEFINE_STANDARD_HANDLE(AIS_Axis, AIS_InteractiveObject)
#endif // _AIS_Axis_HeaderFile
+++ /dev/null
-// 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;}
// 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>
}
-
-//=======================================================================
-//function : SetColor
-//purpose :
-//=======================================================================
-
-void AIS_Circle::SetColor(const Quantity_NameOfColor aCol)
-{
- SetColor(Quantity_Color(aCol));
-}
-
//=======================================================================
//function : SetColor
//purpose :
#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)
+class Geom_Circle;
//! 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);
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.
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;
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
+++ /dev/null
-// 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;
-}
}
if (theShape->HasColor())
{
- SetColor (theShape->Color());
+ Quantity_Color aColor;
+ theShape->Color (aColor);
+ SetColor (aColor);
}
if (theShape->HasWidth())
{
}
}
-//=======================================================================
-//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 :
return theIObj->HasColor();
}
-//=======================================================================
-//function : Color
-//purpose :
-//=======================================================================
-Quantity_NameOfColor AIS_InteractiveContext::Color (const Handle(AIS_InteractiveObject)& theIObj) const
-{
- return theIObj->Color();
-}
-
//=======================================================================
//function : Color
//purpose :
//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())
}
setContextToObject (theIObj);
- theIObj->SetMaterial (theName);
+ theIObj->SetMaterial (theMaterial);
redisplayPrsRecModes (theIObj, theToUpdateViewer);
}
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);
#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>
//! 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
//! 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);
//! 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;
: SelectMgr_SelectableObject (aTypeOfPresentation3d),
myCTXPtr (NULL),
myOwnWidth (0.0),
- myOwnMaterial (Graphic3d_NOM_DEFAULT),
myCurrentFacingModel (Aspect_TOFM_BOTH_SIDE),
myInfiniteState (Standard_False),
hasOwnColor (Standard_False),
//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);
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)
{
*myDrawer->ShadingAspect()->Aspect() = *myDrawer->Link()->ShadingAspect()->Aspect();
}
}
+
myDrawer->ShadingAspect()->SetMaterial (theMaterial);
hasOwnMaterial = Standard_True;
}
//! 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
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.
//! - 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
TColStd_ListOfInteger myToRecomputeModes;
Standard_Real myOwnWidth;
- Graphic3d_NameOfMaterial myOwnMaterial;
Aspect_TypeOfFacingModel myCurrentFacingModel;
Standard_Boolean myInfiniteState;
Standard_Boolean hasOwnColor;
// 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>
}
}
-
//=======================================================================
//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;
#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
//! 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;
-
+ virtual Standard_Integer Signature() const Standard_OVERRIDE { return 5; }
+
//! Returns the type Datum.
- virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
-
+ virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE { return AIS_KOI_Datum; }
+
//! 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;
-
+ 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)& L);
-
+ void SetLine (const Handle(Geom_Line)& theLine)
+ {
+ myComponent = theLine;
+ myLineIsSegment = Standard_False;
+ }
- //! Sets the starting point P1 and ending point P2 of the
+ //! 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;
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
+++ /dev/null
-// 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;
-}
// 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>
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
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);
#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_InteractiveObject.hxx>
#include <AIS_TypeOfPlane.hxx>
+#include <gp_Pnt.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>
+
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.
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);
//! 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;
-
+ 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; }
- //! Provides settings for the center aCenter other than (0, 0, 0).
- void SetCenter (const gp_Pnt& aCenter);
-
//! 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
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
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:
-
+ Standard_EXPORT void SetColor (const Quantity_Color& aColor) Standard_OVERRIDE;
+ Standard_EXPORT void UnsetColor() Standard_OVERRIDE;
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;
Standard_EXPORT void InitDrawerAttributes();
+private:
+
Handle(Geom_Plane) myComponent;
Handle(Geom_Axis2Placement) myAx2;
gp_Pnt myCenter;
Standard_Boolean myHasOwnSize;
Select3D_TypeOfSensitivity myTypeOfSensitivity;
-
};
-
-#include <AIS_Plane.lxx>
-
-
-
-
+DEFINE_STANDARD_HANDLE(AIS_Plane, AIS_InteractiveObject)
#endif // _AIS_Plane_HeaderFile
+++ /dev/null
-// 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;
-}
//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);
}
}
-void AIS_PlaneTrihedron::SetColor(const Quantity_NameOfColor aCol)
-{
- SetColor(Quantity_Color(aCol));
-}
-
void AIS_PlaneTrihedron::SetColor(const Quantity_Color &aCol)
{
hasOwnColor=Standard_True;
#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
//! 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);
//! 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;
-
- //! Returns datum as the type of Interactive Object.
- virtual AIS_KindOfInteractive Type() const Standard_OVERRIDE;
-
- //! 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);
+ virtual Standard_Integer Signature() const Standard_OVERRIDE { return 4; }
+ //! Returns datum as the type of Interactive Object.
+ 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_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
+++ /dev/null
-// 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;
-}
// 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>
//=======================================================================
//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;
#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();
//! 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;
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
+++ /dev/null
-// 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;}
myBndBox = getBoundingBox (myPoints);
}
-//=======================================================================
-//function : SetColor
-//purpose :
-//=======================================================================
-void AIS_PointCloud::SetColor (const Quantity_NameOfColor theColor)
-{
- SetColor (Quantity_Color (theColor));
-}
-
//=======================================================================
//function : SetColor
//purpose :
}
}
-//=======================================================================
-//function : SetMaterial
-//purpose :
-//=======================================================================
-void AIS_PointCloud::SetMaterial (const Graphic3d_NameOfMaterial theMatName)
-{
- SetMaterial (Graphic3d_MaterialAspect (theMatName));
-}
-
//=======================================================================
//function : SetMaterial
//purpose :
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;
//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;
#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_KindOfDimension.hxx>
+#include <AIS_KindOfInteractive.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 <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
//! 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();
-
+
+ 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;
-
+ const Handle(Geom_Plane)& Plane() const { return myPlane; }
- //! Allows you to set the plane aPlane. This is used to
+ //! 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
//! - 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.
//! - 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.
//! 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;
Standard_Boolean myIsSetBndBox;
Standard_Boolean myArrowSizeIsDefined;
-
-private:
-
-
-
-
};
-
-#include <AIS_Relation.lxx>
-
-
-
-
+DEFINE_STANDARD_HANDLE(AIS_Relation, AIS_InteractiveObject)
#endif // _AIS_Relation_HeaderFile
+++ /dev/null
-// 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;
-}
// 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>
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);
}
return myDrawer->ShadingAspect()->Transparency(myCurrentFacingModel);
}
-//=======================================================================
-//function : SetColor
-//purpose :
-//=======================================================================
-
-void AIS_Shape::SetColor(const Quantity_NameOfColor aCol)
-{
- SetColor(Quantity_Color(aCol));
-}
-
//=======================================================================
//function : setColor
//purpose :
}
}
-//=======================================================================
-//function : SetMaterial
-//purpose :
-//=======================================================================
-
-void AIS_Shape::SetMaterial(const Graphic3d_NameOfMaterial aMat)
-{
- SetMaterial(Graphic3d_MaterialAspect(aMat));
-}
-
//=======================================================================
//function : SetMaterial
//purpose :
#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
//! 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);
//! 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();
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:
//! 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;
//! 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;
//! 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;
//! - 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;
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
+++ /dev/null
-// 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();
-}
//! 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 {}
//! 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;
AIS_AttributeFilter.lxx
AIS_Axis.cxx
AIS_Axis.hxx
-AIS_Axis.lxx
AIS_BadEdgeFilter.cxx
AIS_BadEdgeFilter.hxx
AIS_C0RegularityFilter.cxx
AIS_Chamf3dDimension.lxx
AIS_Circle.cxx
AIS_Circle.hxx
-AIS_Circle.lxx
AIS_ClearMode.hxx
AIS_ColoredDrawer.hxx
AIS_ColoredShape.cxx
AIS_LengthDimension.hxx
AIS_Line.cxx
AIS_Line.hxx
-AIS_Line.lxx
AIS_ListIteratorOfListOfInteractive.hxx
AIS_ListOfInteractive.hxx
AIS_LocalContext.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
AIS_SequenceOfInteractive.hxx
AIS_Shape.cxx
AIS_Shape.hxx
-AIS_Shape.lxx
AIS_SignatureFilter.cxx
AIS_SignatureFilter.hxx
AIS_StandardDatum.hxx
SetBackground (theBackground.Color());
}
-void Aspect_Window::SetBackground (const Quantity_NameOfColor theNameOfColor)
-{
- MyBackground.SetColor (theNameOfColor);
-}
-
void Aspect_Window::SetBackground (const Quantity_Color& theColor)
{
MyBackground.SetColor (theColor);
#include <Aspect_FillMethod.hxx>
#include <Standard_Boolean.hxx>
#include <MMgt_TShared.hxx>
-#include <Quantity_NameOfColor.hxx>
+#include <Quantity_Color.hxx>
#include <Aspect_GradientFillMethod.hxx>
#include <Aspect_TypeOfResize.hxx>
#include <Quantity_Ratio.hxx>
class Aspect_WindowDefinitionError;
class Aspect_WindowError;
class Aspect_Background;
-class Quantity_Color;
class Aspect_GradientBackground;
-
class Aspect_Window;
DEFINE_STANDARD_HANDLE(Aspect_Window, MMgt_TShared)
//! Modifies the window background.
Standard_EXPORT void SetBackground (const Aspect_Background& ABack);
-
- //! Modifies the window background from a Named Color.
- Standard_EXPORT void SetBackground (const Quantity_NameOfColor theNameOfColor);
-
+
//! Modifies the window background.
Standard_EXPORT void SetBackground (const Quantity_Color& color);
protected:
-
//! Initializes the datas of a Window.
Standard_EXPORT Aspect_Window();
+protected:
+
Aspect_Background MyBackground;
Aspect_GradientBackground MyGradientBackground;
Aspect_FillMethod MyBackgroundFillMethod;
Standard_Boolean MyIsVirtual;
-
-private:
-
-
-
-
};
-
-
-
-
-
-
#endif // _Aspect_Window_HeaderFile
#include <Prs3d_BasicAspect.hxx>
#include <Quantity_PlaneAngle.hxx>
#include <Quantity_Length.hxx>
-#include <Quantity_NameOfColor.hxx>
//! A framework for displaying arrows in representations of dimensions and relations.
class Prs3d_ArrowAspect : public Prs3d_BasicAspect
Quantity_Length Length() const { return myLength; }
void SetColor (const Quantity_Color& theColor) { myArrowAspect->SetColor (theColor); }
-
- void SetColor (const Quantity_NameOfColor theColor) { SetColor (Quantity_Color (theColor)); }
const Handle(Graphic3d_AspectLine3d)& Aspect() const { return myArrowAspect; }
//! - the type of line aType
//! - the width value aWidth
//! - aNumber, the number of isoparameters to be displayed.
- Prs3d_IsoAspect (const Quantity_NameOfColor theColor,
- const Aspect_TypeOfLine theType,
- const Standard_Real theWidth,
- const Standard_Integer theNumber)
- : Prs3d_LineAspect (theColor, theType, theWidth),
- myNumber (theNumber) {}
-
Prs3d_IsoAspect (const Quantity_Color& theColor,
const Aspect_TypeOfLine theType,
const Standard_Real theWidth,
{
//
}
-
-// =======================================================================
-// function : Prs3d_LineAspect
-// purpose :
-// =======================================================================
-Prs3d_LineAspect::Prs3d_LineAspect (const Quantity_NameOfColor theColor,
- const Aspect_TypeOfLine theType,
- const Standard_Real theWidth)
-: myAspect (new Graphic3d_AspectLine3d (Quantity_Color (theColor), theType, theWidth))
-{
- //
-}
//! - the type of line aType and
//! - the line thickness aWidth.
//! Type of line refers to whether the line is solid or dotted, for example.
- Standard_EXPORT Prs3d_LineAspect (const Quantity_NameOfColor theColor, const Aspect_TypeOfLine theType, const Standard_Real theWidth);
-
Standard_EXPORT Prs3d_LineAspect (const Quantity_Color& theColor, const Aspect_TypeOfLine theType, const Standard_Real theWidth);
Prs3d_LineAspect(const Handle(Graphic3d_AspectLine3d)& theAspect) : myAspect (theAspect) {}
- void SetColor (const Quantity_Color& theColor) { myAspect->SetColor (theColor); }
-
//! Sets the line color defined at the time of construction.
//! Default value: Quantity_NOC_YELLOW
- void SetColor (const Quantity_NameOfColor theColor) { myAspect->SetColor (Quantity_Color (theColor)); }
-
+ void SetColor (const Quantity_Color& theColor) { myAspect->SetColor (theColor); }
+
//! Sets the type of line defined at the time of construction.
//! This could, for example, be solid, dotted or made up of dashes.
//! Default value: Aspect_TOL_SOLID
//
}
-// =======================================================================
-// function : Prs3d_PointAspect
-// purpose :
-// =======================================================================
-Prs3d_PointAspect::Prs3d_PointAspect (const Aspect_TypeOfMarker theType,
- const Quantity_NameOfColor theColor,
- const Standard_Real theScale)
-: myAspect (new Graphic3d_AspectMarker3d (theType, Quantity_Color(theColor), theScale))
-{
- //
-}
-
// =======================================================================
// function : Prs3d_PointAspect
// purpose :
public:
Standard_EXPORT Prs3d_PointAspect(const Aspect_TypeOfMarker theType, const Quantity_Color& theColor, const Standard_Real theScale);
-
- Standard_EXPORT Prs3d_PointAspect(const Aspect_TypeOfMarker theType, const Quantity_NameOfColor theColor, const Standard_Real theScale);
//! Defines the user defined marker point.
Standard_EXPORT Prs3d_PointAspect (const Quantity_Color& theColor,
Prs3d_PointAspect (const Handle(Graphic3d_AspectMarker3d)& theAspect) : myAspect (theAspect) {}
- void SetColor (const Quantity_Color& theColor) { myAspect->SetColor (theColor); }
-
//! defines the color to be used when drawing a point.
//! Default value: Quantity_NOC_YELLOW
- void SetColor (const Quantity_NameOfColor theColor) { myAspect->SetColor (Quantity_Color (theColor)); }
-
+ void SetColor (const Quantity_Color& theColor) { myAspect->SetColor (theColor); }
+
//! defines the type of representation to be used when drawing a point.
//! Default value: Aspect_TOM_PLUS
void SetTypeOfMarker (const Aspect_TypeOfMarker theType) { myAspect->SetType (theType); }
//! Change the polygons interior color and material ambient color.
Standard_EXPORT void SetColor (const Quantity_Color& aColor, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
-
- //! Change the polygons interior color and material ambient color.
- void SetColor (const Quantity_NameOfColor theColor,
- const Aspect_TypeOfFacingModel theModel = Aspect_TOFM_BOTH_SIDE)
- {
- SetColor (Quantity_Color (theColor), theModel);
- }
//! Change the polygons material aspect.
Standard_EXPORT void SetMaterial (const Graphic3d_MaterialAspect& aMaterial, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
- void SetMaterial (const Graphic3d_NameOfMaterial theMaterial, const Aspect_TypeOfFacingModel theModel = Aspect_TOFM_BOTH_SIDE)
- {
- SetMaterial (Graphic3d_MaterialAspect (theMaterial), theModel);
- }
-
//! Change the polygons transparency value.
//! Warning : aValue must be in the range 0,1. 0 is the default (NO transparent)
Standard_EXPORT void SetTransparency (const Standard_Real aValue, const Aspect_TypeOfFacingModel aModel = Aspect_TOFM_BOTH_SIDE);
Standard_EXPORT Prs3d_TextAspect();
Standard_EXPORT Prs3d_TextAspect(const Handle(Graphic3d_AspectText3d)& theAspect);
-
- void SetColor (const Quantity_Color& theColor) { myTextAspect->SetColor (theColor); }
-
+
//! Sets the color of the type used in text display.
- void SetColor (const Quantity_NameOfColor theColor) { myTextAspect->SetColor (Quantity_Color (theColor)); }
-
+ void SetColor (const Quantity_Color& theColor) { myTextAspect->SetColor (theColor); }
+
//! Sets the font used in text display.
void SetFont (const Standard_CString theFont) { myTextAspect->SetFont (theFont); }
{
Backup();
if ( getData()->HasOwnColor() && getData()->Color() == theColor )
- if ( !myAIS.IsNull() && myAIS->HasColor() && myAIS->Color() == theColor )
- return;
+ {
+ if (!myAIS.IsNull() && myAIS->HasColor())
+ {
+ Quantity_Color aColor;
+ myAIS->Color (aColor);
+ if (aColor.Name() == theColor)
+ {
+ return;
+ }
+ }
+ }
getData()->SetColor(theColor);
if ( !myAIS.IsNull() )
{
- if ( myAIS->HasColor() && myAIS->Color() == theColor )
- return; // AIS has already had that color
+ if (myAIS->HasColor())
+ {
+ Quantity_Color aColor;
+ myAIS->Color (aColor);
+ if (aColor.Name() == theColor)
+ {
+ return; // AIS has already had that color
+ }
+ }
Handle(AIS_InteractiveContext) aContext = getAISContext();
if ( HasOwnColor() )
{
Quantity_NameOfColor aColor = Color();
- if ( !(myAIS->HasColor()) || (myAIS->HasColor() && myAIS->Color() != aColor) )
+ Quantity_Color aPrsColor;
+ myAIS->Color (aPrsColor);
+ if ( !(myAIS->HasColor()) || (myAIS->HasColor() && aPrsColor.Name() != aColor) )
{
if ( !aContext.IsNull() )
aContext->SetColor(myAIS, aColor, Standard_False);
if (!anAISObject.IsNull() && anAISObject->HasInteractiveContext()) {
if (!apConstraint->Verified()) {
TPrsStd_ConstraintTools::UpdateOnlyValue(apConstraint,anAISObject);
- if (anAISObject->Color() != Quantity_NOC_RED) anAISObject->SetColor(Quantity_NOC_RED);
+ Quantity_Color aColor;
+ anAISObject->Color (aColor);
+ if (aColor.Name() != Quantity_NOC_RED)
+ {
+ anAISObject->SetColor(Quantity_NOC_RED);
+ }
return Standard_True;
}
}
}
if (anAISObject->HasInteractiveContext()) {
- Quantity_NameOfColor originColor = anAISObject->Color();
+ Quantity_Color originColor;
+ anAISObject->Color (originColor);
if (!apConstraint->Verified()) {
- if (originColor != Quantity_NOC_RED)
+ if (originColor.Name() != Quantity_NOC_RED)
anAISObject->SetColor(Quantity_NOC_RED);
}
else if (apConstraint->IsDimension() && apConstraint->GetValue()->IsCaptured()) {
- if (originColor != Quantity_NOC_PURPLE)
+ if (originColor.Name() != Quantity_NOC_PURPLE)
anAISObject->SetColor(Quantity_NOC_PURPLE);
}
- else if (!apConstraint->IsPlanar() && (originColor != Quantity_NOC_YELLOW))
+ else if (!apConstraint->IsPlanar() && (originColor.Name() != Quantity_NOC_YELLOW))
anAISObject->SetColor(Quantity_NOC_YELLOW);
}
else {
// purpose :
// =======================================================================
V3d_AmbientLight::V3d_AmbientLight (const Handle(V3d_Viewer)& theViewer,
- const Quantity_NameOfColor theColor)
+ const Quantity_Color& theColor)
: V3d_Light (theViewer)
{
SetType (V3d_AMBIENT);
//! Constructs an ambient light source in the viewer.
//! The default Color of this light source is WHITE.
Standard_EXPORT V3d_AmbientLight (const Handle(V3d_Viewer)& theViewer,
- const Quantity_NameOfColor theColor = Quantity_NOC_WHITE);
+ const Quantity_Color& theColor = Quantity_NOC_WHITE);
DEFINE_STANDARD_RTTIEXT(V3d_AmbientLight,V3d_Light)
};
// =======================================================================
V3d_DirectionalLight::V3d_DirectionalLight (const Handle(V3d_Viewer)& theViewer,
const V3d_TypeOfOrientation theDirection,
- const Quantity_NameOfColor theColor,
+ const Quantity_Color& theColor,
const Standard_Boolean theIsHeadlight)
: V3d_PositionLight (theViewer)
{
const Standard_Real theXp,
const Standard_Real theYp,
const Standard_Real theZp,
- const Quantity_NameOfColor theColor,
+ const Quantity_Color& theColor,
const Standard_Boolean theIsHeadlight)
: V3d_PositionLight (theViewer)
{
Standard_Real X0,Y0,Z0,VX,VY,VZ;
Standard_Real X1,Y1,Z1;
Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
- Standard_Real R1,G1,B1;
V3d_TypeOfRepresentation Pres;
// Creation of a structure of markable elements (position of the
//Display of the position of the light.
- this->Color(Quantity_TOC_RGB,R1,G1,B1);
- Quantity_Color Col1(R1,G1,B1,Quantity_TOC_RGB);
+ const Quantity_Color Col1 = this->Color();
Handle(Graphic3d_AspectLine3d) Asp1 = new Graphic3d_AspectLine3d();
Asp1->SetColor(Col1);
glight->SetPrimitivesAspect(Asp1);
//! Creates a directional light source in the viewer.
Standard_EXPORT V3d_DirectionalLight (const Handle(V3d_Viewer)& theViewer,
const V3d_TypeOfOrientation theDirection = V3d_XposYposZpos,
- const Quantity_NameOfColor theColor = Quantity_NOC_WHITE,
+ const Quantity_Color& theColor = Quantity_NOC_WHITE,
const Standard_Boolean theIsHeadlight = Standard_False);
//! Creates a directional light source in the viewer.
const V3d_Coordinate theXp,
const V3d_Coordinate theYp,
const V3d_Coordinate theZp,
- const Quantity_NameOfColor theColor = Quantity_NOC_WHITE,
+ const Quantity_Color& theColor = Quantity_NOC_WHITE,
const Standard_Boolean theIsHeadlight = Standard_False);
//! Defines the direction of the light source by a predefined orientation.
myLight.Type = (Graphic3d_TypeOfLightSource)theType;
}
-// =======================================================================
-// function : SetColor
-// purpose :
-// =======================================================================
-void V3d_Light::SetColor (const Quantity_TypeOfColor theType,
- const Standard_Real theValue1,
- const Standard_Real theValue2,
- const Standard_Real theValue3)
-{
- Standard_Real aValue1 = Max (0., Min (1., theValue1));
- Standard_Real aValue2 = Max (0., Min (1., theValue2));
- Standard_Real aValue3 = Max (0., Min (1., theValue3));
- Quantity_Color aColor (aValue1, aValue2, aValue3, theType);
- SetColor (aColor);
-}
-
-// =======================================================================
-// function : SetColor
-// purpose :
-// =======================================================================
-void V3d_Light::SetColor (const Quantity_NameOfColor theName)
-{
- SetColor (Quantity_Color (theName));
-}
-
// =======================================================================
// function : SetColor
// purpose :
myLight.Color.b() = static_cast<Standard_ShortReal> (theColor.Blue());
}
-// =======================================================================
-// function : Color
-// purpose :
-// =======================================================================
-void V3d_Light::Color (const Quantity_TypeOfColor theType,
- Standard_Real& theValue1,
- Standard_Real& theValue2,
- Standard_Real& theValue3) const
-{
- Color().Values (theValue1, theValue2, theValue3, theType);
-}
-
-// =======================================================================
-// function : Color
-// purpose :
-// =======================================================================
-void V3d_Light::Color (Quantity_NameOfColor& theName) const
-{
- theName = Color().Name();
-}
-
-// =======================================================================
-// function : Color
-// purpose :
-// =======================================================================
-Quantity_Color V3d_Light::Color() const
-{
- return Quantity_Color (Standard_Real (myLight.Color.r()),
- Standard_Real (myLight.Color.g()),
- Standard_Real (myLight.Color.b()),
- Quantity_TOC_RGB);
-}
-
// =======================================================================
// function : Type
// purpose :
#include <Graphic3d_CLight.hxx>
#include <Graphic3d_Vertex.hxx>
#include <MMgt_TShared.hxx>
-#include <Quantity_NameOfColor.hxx>
+#include <Quantity_Color.hxx>
#include <Quantity_Parameter.hxx>
-#include <Quantity_TypeOfColor.hxx>
#include <Standard.hxx>
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <V3d_View.hxx>
class Graphic3d_Structure;
-class Quantity_Color;
class V3d_Viewer;
class V3d_Light;
{
public:
- //! Defines the color of a light source according to the type of color
- //! definition and the three corresponding values.
- Standard_EXPORT void SetColor (const Quantity_TypeOfColor theType,
- const Quantity_Parameter theValue1,
- const Quantity_Parameter theValue2,
- const Quantity_Parameter theValue3);
-
- //! Defines the color of a light source by giving
- //! the name of the color in the form Quantity_NOC_xxxx.
- Standard_EXPORT void SetColor (const Quantity_NameOfColor theName);
-
//! Defines the color of a light source by giving the basic color.
Standard_EXPORT void SetColor (const Quantity_Color& theColor);
- //! Returns the color of the light source depending of the color type.
- Standard_EXPORT void Color (const Quantity_TypeOfColor theType,
- Quantity_Parameter& theValue1,
- Quantity_Parameter& theValue2,
- Quantity_Parameter& theValue3) const;
-
- //! Returns the color of the light source.
- Standard_EXPORT void Color (Quantity_NameOfColor& theName) const;
-
//! Returns the color of the light source.
- Standard_EXPORT Quantity_Color Color() const;
+ Quantity_Color Color() const { return Quantity_Color (myLight.Color.rgb()); }
//! Returns the Type of the Light
Standard_EXPORT V3d_TypeOfLight Type() const;
Standard_Real X0,Y0,Z0,VX,VY,VZ;
Standard_Real X1,Y1,Z1;
Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
- Standard_Real R1,G1,B1;
V3d_TypeOfRepresentation Pres;
// Creation of a structure of markable elements (position of the
// Display of the light position.
- this->Color(Quantity_TOC_RGB,R1,G1,B1);
- Quantity_Color Col1(R1,G1,B1,Quantity_TOC_RGB);
+ const Quantity_Color Col1 = this->Color();
Handle(Graphic3d_AspectLine3d) Asp1 = new Graphic3d_AspectLine3d();
Asp1->SetColor(Col1);
glight->SetPrimitivesAspect(Asp1);
const Standard_Real theX,
const Standard_Real theY,
const Standard_Real theZ,
- const Quantity_NameOfColor theColor,
+ const Quantity_Color& theColor,
const Standard_Real theConstAttenuation,
const Standard_Real theLinearAttenuation)
: V3d_PositionLight (theViewer)
{
SetType (V3d_POSITIONAL);
- SetColor (Quantity_Color (theColor));
+ SetColor (theColor);
SetTarget (0., 0., 0.);
SetPosition (theX, theY, theZ);
SetAttenuation (theConstAttenuation, theLinearAttenuation);
const Standard_Real theXp,
const Standard_Real theYp,
const Standard_Real theZp,
- const Quantity_NameOfColor theColor,
+ const Quantity_Color& theColor,
const Standard_Real theConstAttenuation,
const Standard_Real theLinearAttenuation)
: V3d_PositionLight (theViewer)
{
SetType (V3d_POSITIONAL);
- SetColor (Quantity_Color (theColor));
+ SetColor (theColor);
SetTarget (theXt, theYt, theZt);
SetPosition (theXp, theYp, theZp);
SetAttenuation (theConstAttenuation, theLinearAttenuation);
Standard_Real X0,Y0,Z0,VX,VY,VZ;
Standard_Real X1,Y1,Z1;
Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
- Standard_Real R1,G1,B1;
V3d_TypeOfRepresentation Pres;
// Creation of a structure slight of markable elements (position of the
// Display of the position of the light.
- this->Color(Quantity_TOC_RGB,R1,G1,B1);
- Quantity_Color Col1(R1,G1,B1,Quantity_TOC_RGB);
+ const Quantity_Color Col1 = this->Color();
Handle(Graphic3d_AspectLine3d) Asp1 = new Graphic3d_AspectLine3d();
Asp1->SetColor(Col1);
glight->SetPrimitivesAspect(Asp1);
const V3d_Coordinate theX,
const V3d_Coordinate theY,
const V3d_Coordinate theZ,
- const Quantity_NameOfColor theColor = Quantity_NOC_WHITE,
+ const Quantity_Color& theColor = Quantity_NOC_WHITE,
const Quantity_Coefficient theConstAttenuation = 1.0,
const Quantity_Coefficient theLinearAttenuation = 0.0);
const V3d_Coordinate theXp,
const V3d_Coordinate theYp,
const V3d_Coordinate theZp,
- const Quantity_NameOfColor theColor = Quantity_NOC_WHITE,
+ const Quantity_Color& theColor = Quantity_NOC_WHITE,
const Quantity_Coefficient theConstAttenuation = 1.0,
const Quantity_Coefficient theLinearAttenuation = 0.0);
const Standard_Real theY,
const Standard_Real theZ,
const V3d_TypeOfOrientation theDirection,
- const Quantity_NameOfColor theColor,
+ const Quantity_Color& theColor,
const Standard_Real theConstAttenuation,
const Standard_Real theLinearAttenuation,
const Standard_Real theConcentration,
const Standard_Real theXp,
const Standard_Real theYp,
const Standard_Real theZp,
- const Quantity_NameOfColor theColor,
+ const Quantity_Color& theColor,
const Standard_Real theConstAttenuation,
const Standard_Real theLinearAttenuation,
const Standard_Real theConcentration,
Standard_Real X0,Y0,Z0,VX,VY,VZ;
Standard_Real X1,Y1,Z1;
Standard_Real DXRef,DYRef,DZRef,DXini,DYini,DZini;
- Standard_Real R1,G1,B1;
V3d_TypeOfRepresentation Pres;
// Creation of a structure slight of markable elements (position of the
//Display of the position of the light.
- this->Color(Quantity_TOC_RGB,R1,G1,B1);
- Quantity_Color Col1(R1,G1,B1,Quantity_TOC_RGB);
+ const Quantity_Color Col1 = this->Color();
Handle(Graphic3d_AspectLine3d) Asp1 = new Graphic3d_AspectLine3d();
Asp1->SetColor(Col1);
glight->SetPrimitivesAspect(Asp1);
const V3d_Coordinate theY,
const V3d_Coordinate theZ,
const V3d_TypeOfOrientation theDirection = V3d_XnegYnegZpos,
- const Quantity_NameOfColor theColor = Quantity_NOC_WHITE,
+ const Quantity_Color& theColor = Quantity_NOC_WHITE,
const Quantity_Coefficient theConstAttenuation = 1.0,
const Quantity_Coefficient theLinearAttenuation = 0.0,
const Quantity_Coefficient theConcentration = 1.0,
const V3d_Coordinate theXp,
const V3d_Coordinate theYp,
const V3d_Coordinate theZp,
- const Quantity_NameOfColor theColor = Quantity_NOC_WHITE,
+ const Quantity_Color& theColor = Quantity_NOC_WHITE,
const Quantity_Coefficient theConstAttenuation = 1.0,
const Quantity_Coefficient theLinearAttenuation = 0.0,
const Quantity_Coefficient theConcentration = 1.0,
}
}
-//=============================================================================
-//function : SetBackgroundColor
-//purpose :
-//=============================================================================
-void V3d_View::SetBackgroundColor (const Quantity_NameOfColor theName)
-{
- SetBackgroundColor (Quantity_Color (theName));
-}
-
//=============================================================================
//function : SetBgGradientColors
//purpose :
}
}
-//=============================================================================
-//function : SetBgGradientColors
-//purpose :
-//=============================================================================
-void V3d_View::SetBgGradientColors (const Quantity_NameOfColor theColor1,
- const Quantity_NameOfColor theColor2,
- const Aspect_GradientFillMethod theFillStyle,
- const Standard_Boolean theToUpdate)
-{
- Quantity_Color aColor1 (theColor1);
- Quantity_Color aColor2 (theColor2);
-
- SetBgGradientColors (aColor1, aColor2, theFillStyle, theToUpdate);
-}
-
//=============================================================================
//function : SetBgGradientStyle
//purpose :
#include <Quantity_Coefficient.hxx>
#include <Quantity_Factor.hxx>
#include <Quantity_Length.hxx>
-#include <Quantity_NameOfColor.hxx>
#include <Quantity_Parameter.hxx>
#include <Quantity_PlaneAngle.hxx>
#include <Quantity_Ratio.hxx>
//! Defines the background color of the view.
Standard_EXPORT void SetBackgroundColor (const Quantity_Color& theColor);
- //! Defines the background color of the view by supplying the color name in the form Quantity_NOC_xxxx.
- Standard_EXPORT void SetBackgroundColor (const Quantity_NameOfColor theName);
-
//! Defines the gradient background colors of the view by supplying the colors
//! and the fill method (horizontal by default).
Standard_EXPORT void SetBgGradientColors (const Quantity_Color& theColor1,
const Aspect_GradientFillMethod theFillStyle = Aspect_GFM_HOR,
const Standard_Boolean theToUpdate = Standard_False);
- //! Defines the gradient background colors of the view by supplying the color names
- //! and the fill method (horizontal by default).
- Standard_EXPORT void SetBgGradientColors (const Quantity_NameOfColor theColor1,
- const Quantity_NameOfColor theColor2,
- const Aspect_GradientFillMethod theFillStyle = Aspect_GFM_HOR,
- const Standard_Boolean theToUpdate = Standard_False);
-
//! Defines the gradient background fill method of the view.
Standard_EXPORT void SetBgGradientStyle (const Aspect_GradientFillMethod theMethod = Aspect_GFM_HOR,
const Standard_Boolean theToUpdate = Standard_False);
//! position comes out of the view
//! AxisDiametr - diameter relatively to axis length
//! NbFacettes - number of facets of cylinders and cones
- Standard_EXPORT void ZBufferTriedronSetup (const Quantity_NameOfColor theXColor = Quantity_NOC_RED,
- const Quantity_NameOfColor theYColor = Quantity_NOC_GREEN,
- const Quantity_NameOfColor theZColor = Quantity_NOC_BLUE1,
+ Standard_EXPORT void ZBufferTriedronSetup (const Quantity_Color& theXColor = Quantity_NOC_RED,
+ const Quantity_Color& theYColor = Quantity_NOC_GREEN,
+ const Quantity_Color& theZColor = Quantity_NOC_BLUE1,
const Standard_Real theSizeRatio = 0.8,
const Standard_Real theAxisDiametr = 0.05,
const Standard_Integer theNbFacettes = 12);
//! Initialize position, color and length of Triedron axes.
//! The scale is a percent of the window width.
Standard_EXPORT void TriedronDisplay (const Aspect_TypeOfTriedronPosition thePosition = Aspect_TOTP_CENTER,
- const Quantity_NameOfColor theColor = Quantity_NOC_WHITE,
+ const Quantity_Color& theColor = Quantity_NOC_WHITE,
const Standard_Real theScale = 0.02,
const V3d_TypeOfVisualization theMode = V3d_WIREFRAME);
//function : ZBufferTriedronSetup
//purpose :
//=============================================================================
-void V3d_View::ZBufferTriedronSetup(const Quantity_NameOfColor theXColor,
- const Quantity_NameOfColor theYColor,
- const Quantity_NameOfColor theZColor,
- const Standard_Real theSizeRatio,
- const Standard_Real theAxisDiametr,
- const Standard_Integer theNbFacettes)
+void V3d_View::ZBufferTriedronSetup(const Quantity_Color& theXColor,
+ const Quantity_Color& theYColor,
+ const Quantity_Color& theZColor,
+ const Standard_Real theSizeRatio,
+ const Standard_Real theAxisDiametr,
+ const Standard_Integer theNbFacettes)
{
myTrihedron->SetArrowsColor (theXColor, theYColor, theZColor);
myTrihedron->SetSizeRatio (theSizeRatio);
//purpose :
//=============================================================================
void V3d_View::TriedronDisplay (const Aspect_TypeOfTriedronPosition thePosition,
- const Quantity_NameOfColor theColor,
+ const Quantity_Color& theColor,
const Standard_Real theScale,
const V3d_TypeOfVisualization theMode)
{
const Standard_CString ,
const Standard_Real theViewSize,
const V3d_TypeOfOrientation theViewProj,
- const Quantity_NameOfColor theViewBackground,
+ const Quantity_Color& theViewBackground,
const V3d_TypeOfVisualization theVisualization,
const V3d_TypeOfShadingModel theShadingModel,
const Standard_Boolean theComputedMode,
//! Set default Rendering Parameters.
void SetDefaultRenderingParams (const Graphic3d_RenderingParams& theParams) { myDefaultRenderingParams = theParams; }
- //! Defines the default background colour of views
- //! attached to the viewer by supplying the name of the
- //! colour under the form Quantity_NOC_xxxx .
- void SetDefaultBackgroundColor (const Quantity_NameOfColor theName) { myBackground.SetColor (Quantity_Color (theName)); }
-
//! Defines the default background colour of views
//! attached to the viewer by supplying the color object
void SetDefaultBackgroundColor (const Quantity_Color& theColor) { myBackground.SetColor (theColor); }
//! Returns the gradient background of the view.
const Aspect_GradientBackground& GetGradientBackground() const { return myGradientBackground; }
-
- //! Defines the default gradient background colours of view
- //! attached to the viewer by supplying the name of the
- //! colours under the form Quantity_NOC_xxxx .
- void SetDefaultBgGradientColors (const Quantity_NameOfColor theName1,
- const Quantity_NameOfColor theName2,
- const Aspect_GradientFillMethod theFillStyle = Aspect_GFM_HOR)
- {
- myGradientBackground.SetColors (Quantity_Color (theName1), Quantity_Color (theName2), theFillStyle);
- }
//! Defines the default gradient background colours of views
//! attached to the viewer by supplying the colour objects
const Standard_CString theDomain = "",
const Quantity_Length theViewSize = 1000.0,
const V3d_TypeOfOrientation theViewProj = V3d_XposYnegZpos,
- const Quantity_NameOfColor theViewBackground = Quantity_NOC_GRAY30,
+ const Quantity_Color& theViewBackground = Quantity_NOC_GRAY30,
const V3d_TypeOfVisualization theVisualization = V3d_ZBUFFER,
const V3d_TypeOfShadingModel theShadingModel = V3d_GOURAUD,
const Standard_Boolean theComputedMode = Standard_True,
Standard_Real value;
Standard_Boolean hascol;
- Quantity_NameOfColor col = Quantity_NOC_BLACK ;
+ Quantity_Color col = Quantity_NOC_BLACK;
// Verification des arguments
if ( argc>3 ) {di<<argv[0]<<" Syntaxe error\n"; return 1;}
// un AIS_Trihedron
if (aShape->Type()==AIS_KOI_Datum && aShape->Signature()==3) {
- if (aShape->HasColor()) {
- hascol=Standard_True;
+ if (aShape->HasColor())
+ {
+ hascol = Standard_True;
// On recupere la couleur de aShape
- col=aShape->Color();}
-
- else hascol=Standard_False;
+ aShape->Color (col);
+ }
+ else
+ {
+ hascol = Standard_False;
+ }
// On downcast aShape de AIS_InteractiveObject a AIS_Trihedron
// pour lui appliquer la methode SetSize()
if (!aShape.IsNull() &&
aShape->Type()==AIS_KOI_Datum && aShape->Signature()==3)
{
-
- if (aShape->HasColor()) {
+ if (aShape->HasColor())
+ {
hascol=Standard_True;
// On recupere la couleur de aShape
- col=aShape->Color();}
-
- else hascol=Standard_False;
+ aShape->Color (col);
+ }
+ else
+ {
+ hascol = Standard_False;
+ }
// On downcast aShape de AIS_InteractiveObject a AIS_Trihedron
// pour lui appliquer la methode SetSize()
if( !aMesh.IsNull() )
{
TCollection_AsciiString aMode = TCollection_AsciiString (argv[2]);
- Quantity_Color aColor1( (Quantity_NameOfColor)( Quantity_NOC_BLUE1 ) );
- Quantity_Color aColor2( (Quantity_NameOfColor)( Quantity_NOC_RED1 ) );
+ Quantity_Color aColor1(Quantity_NOC_BLUE1);
+ Quantity_Color aColor2(Quantity_NOC_RED1);
if( aMode.IsEqual("elem1") || aMode.IsEqual("elem2") || aMode.IsEqual("nodal") || aMode.IsEqual("nodaltex") || aMode.IsEqual("none") )
{
Handle(MeshVS_PrsBuilder) aTempBuilder;