1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

0031866: Documentation - add description to Graphic3d_NameOfMaterial enumeration values

Enumeration values have been renamed to use complete prefix Graphic3d_NOM_ -> Graphic3d_NameOfMaterial_
and to match string names (with old values preserved as aliases).
This commit is contained in:
kgv 2020-10-21 10:28:12 +03:00 committed by bugmaster
parent 8833fd4dc5
commit a966542b8a
47 changed files with 200 additions and 169 deletions

View File

@ -1556,7 +1556,7 @@ aTriangles->AddVertex ( 100./2., 100./2., 0.0);
Handle(Graphic3d_AspectFillArea3d) anAspects = new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID, Quantity_NOC_RED, Handle(Graphic3d_AspectFillArea3d) anAspects = new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID, Quantity_NOC_RED,
Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0f, Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0f,
Graphic3d_NOM_GOLD, Graphic3d_NOM_GOLD); Graphic3d_NameOfMaterial_Gold, Graphic3d_NameOfMaterial_Gold);
aPrsGroup->SetGroupPrimitivesAspect (anAspects); aPrsGroup->SetGroupPrimitivesAspect (anAspects);
aPrsGroup->AddPrimitiveArray (aTriangles); aPrsGroup->AddPrimitiveArray (aTriangles);
@ -2018,8 +2018,8 @@ aFirebrickMarker->SetMarkerImage (theImage)
Create facet attributes. Create facet attributes.
~~~~~{.cpp} ~~~~~{.cpp}
Handle(Graphic3d_AspectFillArea3d) aFaceAspect = new Graphic3d_AspectFillArea3d(); Handle(Graphic3d_AspectFillArea3d) aFaceAspect = new Graphic3d_AspectFillArea3d();
Graphic3d_MaterialAspect aBrassMaterial (Graphic3d_NOM_BRASS); Graphic3d_MaterialAspect aBrassMaterial (Graphic3d_NameOfMaterial_Brass);
Graphic3d_MaterialAspect aGoldMaterial (Graphic3d_NOM_GOLD); Graphic3d_MaterialAspect aGoldMaterial (Graphic3d_NameOfMaterial_Gold);
aFaceAspect->SetInteriorStyle (Aspect_IS_SOLID_WIREFRAME); aFaceAspect->SetInteriorStyle (Aspect_IS_SOLID_WIREFRAME);
aFaceAspect->SetInteriorColor (aMyColor); aFaceAspect->SetInteriorColor (aMyColor);
aFaceAspect->SetDistinguishOn (); aFaceAspect->SetDistinguishOn ();

View File

@ -748,7 +748,7 @@ public:
} }
Handle(AIS_Shape) aPrs = new AIS_Shape (aShape); Handle(AIS_Shape) aPrs = new AIS_Shape (aShape);
myAISContext()->SetMaterial (aPrs, Graphic3d_NOM_GOLD, Standard_False); myAISContext()->SetMaterial (aPrs, Graphic3d_NameOfMaterial_Gold, Standard_False);
myAISContext()->SetDisplayMode(aPrs, AIS_Shaded, Standard_False); myAISContext()->SetDisplayMode(aPrs, AIS_Shaded, Standard_False);
myAISContext()->Display (aPrs, Standard_True); myAISContext()->Display (aPrs, Standard_True);
return true; return true;

View File

@ -316,7 +316,7 @@ void OcctViewer::displayWithChildren (XCAFDoc_ShapeTool& theShapeToo
Handle(AIS_InteractiveObject) anAis; Handle(AIS_InteractiveObject) anAis;
if (!theMapOfShapes.Find (aRefLabel, anAis)) if (!theMapOfShapes.Find (aRefLabel, anAis))
{ {
anAis = new CafShapePrs (aRefLabel, theParentStyle, Graphic3d_NOM_SHINY_PLASTIC); anAis = new CafShapePrs (aRefLabel, theParentStyle, Graphic3d_NameOfMaterial_ShinyPlastified);
theMapOfShapes.Bind (aRefLabel, anAis); theMapOfShapes.Bind (aRefLabel, anAis);
} }

View File

@ -1532,7 +1532,7 @@ Handle(AIS_InteractiveObject) CGeometryDoc::drawSurface
Handle(AIS_Shape) aGraphicSurface = Handle(AIS_Shape) aGraphicSurface =
new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2, Precision::Confusion())); new AIS_Shape(BRepBuilderAPI_MakeFace (theSurface, u1, u2, v1, v2, Precision::Confusion()));
myAISContext->SetMaterial(aGraphicSurface, Graphic3d_NOM_PLASTIC, toDisplay); myAISContext->SetMaterial(aGraphicSurface, Graphic3d_NameOfMaterial_Plastified, toDisplay);
myAISContext->SetColor(aGraphicSurface, theColor, toDisplay); myAISContext->SetColor(aGraphicSurface, theColor, toDisplay);
if (toDisplay) if (toDisplay)
{ {

View File

@ -76,7 +76,7 @@ public:
// and displays it in the viewer if toDisplay = Standard_True // and displays it in the viewer if toDisplay = Standard_True
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape, Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS, const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NameOfMaterial_Brass,
const Standard_Boolean toDisplay = Standard_True); const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given shape with the given material // creates a presentation of the given shape with the given material
// (color is default for a given material) // (color is default for a given material)

View File

@ -114,7 +114,7 @@ protected:
// and displays it in the viewer if toDisplay = Standard_True // and displays it in the viewer if toDisplay = Standard_True
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape, Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS, const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NameOfMaterial_Brass,
const Standard_Boolean toDisplay = Standard_True); const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given shape with the given material // creates a presentation of the given shape with the given material
// (color is default for a given material) // (color is default for a given material)

View File

@ -46,7 +46,7 @@ void CColoredShapes::Display(Handle(AIS_InteractiveContext)& anAIScontext)
{ {
Handle(AIS_Shape) ais = new AIS_Shape(iter.Value()); Handle(AIS_Shape) ais = new AIS_Shape(iter.Value());
anAIScontext->SetColor(ais, (Quantity_NameOfColor)m_colorMap.Find(iter.Value()), Standard_False); anAIScontext->SetColor(ais, (Quantity_NameOfColor)m_colorMap.Find(iter.Value()), Standard_False);
anAIScontext->SetMaterial(ais, Graphic3d_NOM_GOLD, Standard_False); anAIScontext->SetMaterial(ais, Graphic3d_NameOfMaterial_Gold, Standard_False);
anAIScontext->Display(ais, Standard_False); anAIScontext->Display(ais, Standard_False);
} }
anAIScontext->UpdateCurrentViewer(); anAIScontext->UpdateCurrentViewer();

View File

@ -25,7 +25,7 @@
#define DEFAULT_DCSMALL 0.0002 #define DEFAULT_DCSMALL 0.0002
#define DEFAULT_DCVSMALL 0.00004 #define DEFAULT_DCVSMALL 0.00004
#define DEFAULT_COLOR Quantity_NOC_CYAN1 #define DEFAULT_COLOR Quantity_NOC_CYAN1
#define DEFAULT_MATERIAL Graphic3d_NOM_PLASTER #define DEFAULT_MATERIAL Graphic3d_NameOfMaterial_Plastered
#define DEFAULT_BACKGROUNDCOLOR Quantity_NOC_MATRAGRAY #define DEFAULT_BACKGROUNDCOLOR Quantity_NOC_MATRAGRAY
#define DEFAULT_HILIGHTCOLOR Quantity_NOC_YELLOW #define DEFAULT_HILIGHTCOLOR Quantity_NOC_YELLOW

View File

@ -114,7 +114,7 @@ protected:
// and displays it in the viewer if toDisplay = Standard_True // and displays it in the viewer if toDisplay = Standard_True
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape, Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS, const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NameOfMaterial_Brass,
const Standard_Boolean toDisplay = Standard_True); const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given shape with the given material // creates a presentation of the given shape with the given material
// (color is default for a given material) // (color is default for a given material)

View File

@ -29,7 +29,7 @@
#define DEFAULT_DCSMALL 0.0002 #define DEFAULT_DCSMALL 0.0002
#define DEFAULT_DCVSMALL 0.00004 #define DEFAULT_DCVSMALL 0.00004
#define DEFAULT_COLOR Quantity_NOC_CYAN1 #define DEFAULT_COLOR Quantity_NOC_CYAN1
#define DEFAULT_MATERIAL Graphic3d_NOM_PLASTER #define DEFAULT_MATERIAL Graphic3d_NameOfMaterial_Plastered
#define DEFAULT_BACKGROUNDCOLOR Quantity_NOC_MATRAGRAY #define DEFAULT_BACKGROUNDCOLOR Quantity_NOC_MATRAGRAY
#define DEFAULT_HILIGHTCOLOR Quantity_NOC_YELLOW #define DEFAULT_HILIGHTCOLOR Quantity_NOC_YELLOW

View File

@ -12,7 +12,7 @@
#include "Fonc.hxx" #include "Fonc.hxx"
#define DEFAULT_COLOR Quantity_NOC_CYAN1 #define DEFAULT_COLOR Quantity_NOC_CYAN1
#define DEFAULT_MATERIAL Graphic3d_NOM_PLASTER #define DEFAULT_MATERIAL Graphic3d_NameOfMaterial_Plastered
#define DEFAULT_DEVIATIONCOEFFICIENT 0.001 #define DEFAULT_DEVIATIONCOEFFICIENT 0.001
#define DEFAULT_HILIGHTCOLOR Quantity_NOC_YELLOW #define DEFAULT_HILIGHTCOLOR Quantity_NOC_YELLOW
@ -123,23 +123,23 @@ CAnimationDoc::CAnimationDoc()
myAisCylinderHead = new AIS_Shape (CylinderHead); myAisCylinderHead = new AIS_Shape (CylinderHead);
myAISContext->SetColor (myAisCylinderHead, Quantity_NOC_WHITE, Standard_False); myAISContext->SetColor (myAisCylinderHead, Quantity_NOC_WHITE, Standard_False);
myAISContext->SetMaterial (myAisCylinderHead, Graphic3d_NOM_PLASTIC, Standard_False); myAISContext->SetMaterial (myAisCylinderHead, Graphic3d_NameOfMaterial_Plastified, Standard_False);
myAisEngineBlock = new AIS_Shape (EngineBlock); myAisEngineBlock = new AIS_Shape (EngineBlock);
myAISContext->SetColor(myAisEngineBlock, Quantity_NOC_WHITE, Standard_False); myAISContext->SetColor(myAisEngineBlock, Quantity_NOC_WHITE, Standard_False);
myAISContext->SetMaterial(myAisEngineBlock,Graphic3d_NOM_PLASTIC, Standard_False); myAISContext->SetMaterial(myAisEngineBlock,Graphic3d_NameOfMaterial_Plastified, Standard_False);
myAISContext->Display(myAisCylinderHead ,1,-1,Standard_False); myAISContext->Display(myAisCylinderHead ,1,-1,Standard_False);
myAISContext->Display(myAisEngineBlock ,1,-1,Standard_False); myAISContext->Display(myAisEngineBlock ,1,-1,Standard_False);
myAisCrankArm = new AIS_Shape (CrankArm); myAisCrankArm = new AIS_Shape (CrankArm);
myAISContext->SetColor (myAisCrankArm, Quantity_NOC_HOTPINK, Standard_False); myAISContext->SetColor (myAisCrankArm, Quantity_NOC_HOTPINK, Standard_False);
myAISContext->SetMaterial(myAisCrankArm, Graphic3d_NOM_PLASTIC, Standard_False); myAISContext->SetMaterial(myAisCrankArm, Graphic3d_NameOfMaterial_Plastified, Standard_False);
myAisPiston = new AIS_Shape (Piston); myAisPiston = new AIS_Shape (Piston);
myAISContext->SetColor (myAisPiston , Quantity_NOC_WHITE, Standard_False); myAISContext->SetColor (myAisPiston , Quantity_NOC_WHITE, Standard_False);
myAISContext->SetMaterial(myAisPiston , Graphic3d_NOM_PLASTIC, Standard_False); myAISContext->SetMaterial(myAisPiston , Graphic3d_NameOfMaterial_Plastified, Standard_False);
myAisPropeller = new AIS_Shape (Propeller); myAisPropeller = new AIS_Shape (Propeller);
myAISContext->SetColor (myAisPropeller, Quantity_NOC_RED, Standard_False); myAISContext->SetColor (myAisPropeller, Quantity_NOC_RED, Standard_False);
myAISContext->SetMaterial(myAisPropeller, Graphic3d_NOM_PLASTIC, Standard_False); myAISContext->SetMaterial(myAisPropeller, Graphic3d_NameOfMaterial_Plastified, Standard_False);
myAISContext->Display(myAisCrankArm, 1,-1,Standard_False); myAISContext->Display(myAisCrankArm, 1,-1,Standard_False);
myAISContext->Display(myAisPropeller, 1,-1,Standard_False); myAISContext->Display(myAisPropeller, 1,-1,Standard_False);
@ -316,7 +316,7 @@ void CAnimationDoc::OnFileLoadgrid()
myAISContext->Display(myAISSurface, Standard_False); myAISContext->Display(myAISSurface, Standard_False);
myAISContext->Deactivate(myAISSurface,Standard_False); myAISContext->Deactivate(myAISSurface,Standard_False);
myAISContext->SetColor (myAISSurface,Quantity_NOC_WHITE,Standard_False); myAISContext->SetColor (myAISSurface,Quantity_NOC_WHITE,Standard_False);
myAISContext->SetMaterial (myAISSurface,Graphic3d_NOM_STONE,Standard_False); myAISContext->SetMaterial (myAISSurface,Graphic3d_NameOfMaterial_Stone,Standard_False);
myAISContext->SetDisplayMode (myAISSurface,1,Standard_False); myAISContext->SetDisplayMode (myAISSurface,1,Standard_False);
myAISContext->SetDeviationCoefficient (0.001); myAISContext->SetDeviationCoefficient (0.001);
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd; CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;

View File

@ -39,7 +39,7 @@ enum CurrentAction3d {
#define DEFAULT_DCSMALL 0.0002 #define DEFAULT_DCSMALL 0.0002
#define DEFAULT_DCVSMALL 0.00004 #define DEFAULT_DCVSMALL 0.00004
#define DEFAULT_COLOR Quantity_NOC_CYAN1 #define DEFAULT_COLOR Quantity_NOC_CYAN1
#define DEFAULT_MATERIAL Graphic3d_NOM_PLASTER #define DEFAULT_MATERIAL Graphic3d_NameOfMaterial_Plastered
#define DEFAULT_BACKGROUNDCOLOR Quantity_NOC_MATRAGRAY #define DEFAULT_BACKGROUNDCOLOR Quantity_NOC_MATRAGRAY
#define DEFAULT_HILIGHTCOLOR Quantity_NOC_YELLOW #define DEFAULT_HILIGHTCOLOR Quantity_NOC_YELLOW

View File

@ -113,7 +113,7 @@ protected:
// and displays it in the viewer if toDisplay = Standard_True // and displays it in the viewer if toDisplay = Standard_True
Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape, Handle(AIS_Shape) drawShape (const TopoDS_Shape& theShape,
const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NOM_BRASS, const Graphic3d_NameOfMaterial theMaterial = Graphic3d_NameOfMaterial_Brass,
const Standard_Boolean toDisplay = Standard_True); const Standard_Boolean toDisplay = Standard_True);
// creates a presentation of the given shape with the given material // creates a presentation of the given shape with the given material
// (color is default for a given material) // (color is default for a given material)

View File

@ -26,7 +26,7 @@ void DocumentTut::onMakeBottle()
QApplication::setOverrideCursor( Qt::WaitCursor ); QApplication::setOverrideCursor( Qt::WaitCursor );
TopoDS_Shape aBottle=MakeBottle(50,70,30); TopoDS_Shape aBottle=MakeBottle(50,70,30);
Handle(AIS_Shape) AISBottle=new AIS_Shape(aBottle); Handle(AIS_Shape) AISBottle=new AIS_Shape(aBottle);
getContext()->SetMaterial (AISBottle, Graphic3d_NOM_GOLD, Standard_False); getContext()->SetMaterial (AISBottle, Graphic3d_NameOfMaterial_Gold, Standard_False);
getContext()->SetDisplayMode(AISBottle, 1, Standard_False); getContext()->SetDisplayMode(AISBottle, 1, Standard_False);
getContext()->Display(AISBottle, Standard_False); getContext()->Display(AISBottle, Standard_False);
const Handle(AIS_InteractiveObject)& anIOAISBottle = AISBottle; const Handle(AIS_InteractiveObject)& anIOAISBottle = AISBottle;

View File

@ -46,7 +46,7 @@ extern "C" void onFileDataRead (void* theOpaque, void* theBuffer, int theDataLen
BRepTools::Read (aShape, aStream, aBuilder); BRepTools::Read (aShape, aStream, aBuilder);
Handle(AIS_Shape) aShapePrs = new AIS_Shape (aShape); Handle(AIS_Shape) aShapePrs = new AIS_Shape (aShape);
aShapePrs->SetMaterial (Graphic3d_NOM_SILVER); aShapePrs->SetMaterial (Graphic3d_NameOfMaterial_Silver);
aViewer.Context()->Display (aShapePrs, AIS_Shaded, 0, false); aViewer.Context()->Display (aShapePrs, AIS_Shaded, 0, false);
aViewer.View()->FitAll (0.01, false); aViewer.View()->FitAll (0.01, false);
aViewer.View()->Redraw(); aViewer.View()->Redraw();

View File

@ -43,7 +43,7 @@ AIS_CameraFrustum::AIS_CameraFrustum()
myDrawer->SetLineAspect (new Prs3d_LineAspect (THE_DEFAULT_COLOR, Aspect_TOL_SOLID, 1.0)); myDrawer->SetLineAspect (new Prs3d_LineAspect (THE_DEFAULT_COLOR, Aspect_TOL_SOLID, 1.0));
Handle(Prs3d_ShadingAspect) aShadingAspect = new Prs3d_ShadingAspect(); Handle(Prs3d_ShadingAspect) aShadingAspect = new Prs3d_ShadingAspect();
aShadingAspect->SetMaterial (Graphic3d_NOM_PLASTIC); aShadingAspect->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
aShadingAspect->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend); aShadingAspect->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
aShadingAspect->SetTransparency (THE_DEFAULT_TRANSPARENCY); aShadingAspect->SetTransparency (THE_DEFAULT_TRANSPARENCY);
aShadingAspect->SetColor (THE_DEFAULT_COLOR); aShadingAspect->SetColor (THE_DEFAULT_COLOR);

View File

@ -2180,7 +2180,7 @@ void AIS_InteractiveContext::SetSelectionSensitivity (const Handle(AIS_Interacti
//======================================================================= //=======================================================================
void AIS_InteractiveContext::InitAttributes() void AIS_InteractiveContext::InitAttributes()
{ {
Graphic3d_MaterialAspect aMat (Graphic3d_NOM_BRASS); Graphic3d_MaterialAspect aMat (Graphic3d_NameOfMaterial_Brass);
myDefaultDrawer->ShadingAspect()->SetMaterial (aMat); myDefaultDrawer->ShadingAspect()->SetMaterial (aMat);
// myDefaultDrawer->ShadingAspect()->SetColor(Quantity_NOC_GRAY70); // myDefaultDrawer->ShadingAspect()->SetColor(Quantity_NOC_GRAY70);

View File

@ -588,7 +588,7 @@ void AIS_Plane::ComputeFields()
void AIS_Plane::InitDrawerAttributes() void AIS_Plane::InitDrawerAttributes()
{ {
Handle(Prs3d_ShadingAspect) shasp = new Prs3d_ShadingAspect(); Handle(Prs3d_ShadingAspect) shasp = new Prs3d_ShadingAspect();
shasp->SetMaterial(Graphic3d_NOM_PLASTIC); shasp->SetMaterial(Graphic3d_NameOfMaterial_Plastified);
shasp->SetColor(Quantity_NOC_GRAY40); shasp->SetColor(Quantity_NOC_GRAY40);
myDrawer->SetShadingAspect(shasp); myDrawer->SetShadingAspect(shasp);
Handle(Graphic3d_AspectFillArea3d) asf = shasp->Aspect(); Handle(Graphic3d_AspectFillArea3d) asf = shasp->Aspect();

View File

@ -297,7 +297,7 @@ void AIS_PointCloud::UnsetColor()
AIS_InteractiveObject::UnsetColor(); AIS_InteractiveObject::UnsetColor();
{ {
Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS); Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NameOfMaterial_Brass);
Graphic3d_MaterialAspect aMat = aDefaultMat; Graphic3d_MaterialAspect aMat = aDefaultMat;
Quantity_Color aColor = aDefaultMat.Color(); Quantity_Color aColor = aDefaultMat.Color();
if (myDrawer->HasLink()) if (myDrawer->HasLink())
@ -353,7 +353,7 @@ void AIS_PointCloud::UnsetMaterial()
} }
{ {
Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS); Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NameOfMaterial_Brass);
myDrawer->ShadingAspect()->SetMaterial (myDrawer->HasLink() ? myDrawer->ShadingAspect()->SetMaterial (myDrawer->HasLink() ?
myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel) : myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel) :
aDefaultMat, aDefaultMat,

View File

@ -42,7 +42,7 @@ AIS_RubberBand::AIS_RubberBand()
{ {
myDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0)); myDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0));
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect()); myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC); myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT); myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY); myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend); myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
@ -65,7 +65,7 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
{ {
myDrawer->SetLineAspect (new Prs3d_LineAspect (theLineColor, theLineType, theWidth)); myDrawer->SetLineAspect (new Prs3d_LineAspect (theLineColor, theLineType, theWidth));
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect()); myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC); myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT); myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY); myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_EMPTY);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend); myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
@ -90,7 +90,7 @@ AIS_RubberBand::AIS_RubberBand (const Quantity_Color& theLineColor,
{ {
myDrawer->SetLineAspect (new Prs3d_LineAspect (theLineColor, theLineType, theLineWidth)); myDrawer->SetLineAspect (new Prs3d_LineAspect (theLineColor, theLineType, theLineWidth));
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect()); myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC); myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
myDrawer->ShadingAspect()->SetColor (theFillColor); myDrawer->ShadingAspect()->SetColor (theFillColor);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT); myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_SOLID); myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_SOLID);

View File

@ -489,7 +489,7 @@ void AIS_Shape::UnsetColor()
|| IsTransparent() || IsTransparent()
|| myDrawer->ShadingAspect()->Aspect()->ToMapTexture()) || myDrawer->ShadingAspect()->Aspect()->ToMapTexture())
{ {
const Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS); const Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NameOfMaterial_Brass);
Graphic3d_MaterialAspect mat = aDefaultMat; Graphic3d_MaterialAspect mat = aDefaultMat;
Quantity_Color anInteriorColors[2] = {Quantity_NOC_CYAN1, Quantity_NOC_CYAN1}; Quantity_Color anInteriorColors[2] = {Quantity_NOC_CYAN1, Quantity_NOC_CYAN1};
if (myDrawer->HasLink()) if (myDrawer->HasLink())

View File

@ -200,7 +200,7 @@ void AIS_ViewCube::setDefaultAttributes()
// this should be forced back-face culling regardless Closed flag // this should be forced back-face culling regardless Closed flag
myDrawer->TextAspect()->Aspect()->SetSuppressBackFaces (true); myDrawer->TextAspect()->Aspect()->SetSuppressBackFaces (true);
Graphic3d_MaterialAspect aMat (Graphic3d_NOM_UserDefined); Graphic3d_MaterialAspect aMat (Graphic3d_NameOfMaterial_UserDefined);
aMat.SetColor (Quantity_NOC_WHITE); aMat.SetColor (Quantity_NOC_WHITE);
aMat.SetAmbientColor (Quantity_NOC_GRAY60); aMat.SetAmbientColor (Quantity_NOC_GRAY60);

View File

@ -451,7 +451,7 @@ public:
//! Sets the material for the interactive object. //! Sets the material for the interactive object.
virtual void UnsetMaterial() Standard_OVERRIDE virtual void UnsetMaterial() Standard_OVERRIDE
{ {
Graphic3d_MaterialAspect aMat (Graphic3d_NOM_UserDefined); Graphic3d_MaterialAspect aMat (Graphic3d_NameOfMaterial_UserDefined);
aMat.SetColor (Quantity_NOC_WHITE); aMat.SetColor (Quantity_NOC_WHITE);
aMat.SetAmbientColor (Quantity_NOC_GRAY60); aMat.SetAmbientColor (Quantity_NOC_GRAY60);
myDrawer->ShadingAspect()->SetMaterial (aMat); myDrawer->ShadingAspect()->SetMaterial (aMat);

View File

@ -68,7 +68,7 @@ AIS_XRTrackedDevice::AIS_XRTrackedDevice (const Handle(Graphic3d_ArrayOfTriangle
myToShowAxes (false) myToShowAxes (false)
{ {
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect()); myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_DEFAULT); myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_DEFAULT);
myDrawer->ShadingAspect()->SetColor (Quantity_NOC_WHITE); myDrawer->ShadingAspect()->SetColor (Quantity_NOC_WHITE);
if (!theTexture.IsNull()) if (!theTexture.IsNull())
{ {

View File

@ -27,7 +27,7 @@ namespace
static Handle(Graphic3d_AspectFillArea3d) defaultAspect() static Handle(Graphic3d_AspectFillArea3d) defaultAspect()
{ {
Graphic3d_MaterialAspect aMaterial (Graphic3d_NOM_DEFAULT); Graphic3d_MaterialAspect aMaterial (Graphic3d_NameOfMaterial_DEFAULT);
Handle(Graphic3d_AspectFillArea3d) anAspect = new Graphic3d_AspectFillArea3d(); Handle(Graphic3d_AspectFillArea3d) anAspect = new Graphic3d_AspectFillArea3d();
anAspect->SetDistinguishOff(); anAspect->SetDistinguishOff();
anAspect->SetFrontMaterial (aMaterial); anAspect->SetFrontMaterial (aMaterial);

View File

@ -53,7 +53,7 @@ public:
//! - Equation (0.0, 0.0, 1.0, 0) //! - Equation (0.0, 0.0, 1.0, 0)
//! - IsOn (True), //! - IsOn (True),
//! - IsCapping (False), //! - IsCapping (False),
//! - Material (Graphic3d_NOM_DEFAULT), //! - Material (Graphic3d_NameOfMaterial_DEFAULT),
//! - Texture (NULL), //! - Texture (NULL),
//! - HatchStyle (Aspect_HS_HORIZONTAL), //! - HatchStyle (Aspect_HS_HORIZONTAL),
//! - IsHatchOn (False) //! - IsHatchOn (False)

View File

@ -42,32 +42,32 @@ namespace
//! Name list of standard materials (defined within enumeration). //! Name list of standard materials (defined within enumeration).
static const RawMaterial THE_MATERIALS[] = static const RawMaterial THE_MATERIALS[] =
{ {
RawMaterial (Graphic3d_NOM_BRASS, "Brass"), RawMaterial (Graphic3d_NameOfMaterial_Brass, "Brass"),
RawMaterial (Graphic3d_NOM_BRONZE, "Bronze"), RawMaterial (Graphic3d_NameOfMaterial_Bronze, "Bronze"),
RawMaterial (Graphic3d_NOM_COPPER, "Copper"), RawMaterial (Graphic3d_NameOfMaterial_Copper, "Copper"),
RawMaterial (Graphic3d_NOM_GOLD, "Gold"), RawMaterial (Graphic3d_NameOfMaterial_Gold, "Gold"),
RawMaterial (Graphic3d_NOM_PEWTER, "Pewter"), RawMaterial (Graphic3d_NameOfMaterial_Pewter, "Pewter"),
RawMaterial (Graphic3d_NOM_PLASTER, "Plastered"), RawMaterial (Graphic3d_NameOfMaterial_Plastered, "Plastered"),
RawMaterial (Graphic3d_NOM_PLASTIC, "Plastified"), RawMaterial (Graphic3d_NameOfMaterial_Plastified, "Plastified"),
RawMaterial (Graphic3d_NOM_SILVER, "Silver"), RawMaterial (Graphic3d_NameOfMaterial_Silver, "Silver"),
RawMaterial (Graphic3d_NOM_STEEL, "Steel"), RawMaterial (Graphic3d_NameOfMaterial_Steel, "Steel"),
RawMaterial (Graphic3d_NOM_STONE, "Stone"), RawMaterial (Graphic3d_NameOfMaterial_Stone, "Stone"),
RawMaterial (Graphic3d_NOM_SHINY_PLASTIC, "Shiny_plastified"), RawMaterial (Graphic3d_NameOfMaterial_ShinyPlastified, "Shiny_plastified"),
RawMaterial (Graphic3d_NOM_SATIN, "Satined"), RawMaterial (Graphic3d_NameOfMaterial_Satin, "Satined"),
RawMaterial (Graphic3d_NOM_METALIZED, "Metalized"), RawMaterial (Graphic3d_NameOfMaterial_Metalized, "Metalized"),
RawMaterial (Graphic3d_NOM_NEON_GNC, "Ionized"), RawMaterial (Graphic3d_NameOfMaterial_Ionized, "Ionized"),
RawMaterial (Graphic3d_NOM_CHROME, "Chrome"), RawMaterial (Graphic3d_NameOfMaterial_Chrome, "Chrome"),
RawMaterial (Graphic3d_NOM_ALUMINIUM, "Aluminium"), RawMaterial (Graphic3d_NameOfMaterial_Aluminum, "Aluminium"),
RawMaterial (Graphic3d_NOM_OBSIDIAN, "Obsidian"), RawMaterial (Graphic3d_NameOfMaterial_Obsidian, "Obsidian"),
RawMaterial (Graphic3d_NOM_NEON_PHC, "Neon"), RawMaterial (Graphic3d_NameOfMaterial_Neon, "Neon"),
RawMaterial (Graphic3d_NOM_JADE, "Jade"), RawMaterial (Graphic3d_NameOfMaterial_Jade, "Jade"),
RawMaterial (Graphic3d_NOM_CHARCOAL, "Charcoal"), RawMaterial (Graphic3d_NameOfMaterial_Charcoal, "Charcoal"),
RawMaterial (Graphic3d_NOM_WATER, "Water"), RawMaterial (Graphic3d_NameOfMaterial_Water, "Water"),
RawMaterial (Graphic3d_NOM_GLASS, "Glass"), RawMaterial (Graphic3d_NameOfMaterial_Glass, "Glass"),
RawMaterial (Graphic3d_NOM_DIAMOND, "Diamond"), RawMaterial (Graphic3d_NameOfMaterial_Diamond, "Diamond"),
RawMaterial (Graphic3d_NOM_TRANSPARENT, "Transparent"), RawMaterial (Graphic3d_NameOfMaterial_Transparent, "Transparent"),
RawMaterial (Graphic3d_NOM_DEFAULT, "Default"), RawMaterial (Graphic3d_NameOfMaterial_DEFAULT, "Default"),
RawMaterial (Graphic3d_NOM_UserDefined, "UserDefined") RawMaterial (Graphic3d_NameOfMaterial_UserDefined, "UserDefined")
}; };
} }
@ -88,7 +88,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
{ {
switch (theName) switch (theName)
{ {
case Graphic3d_NOM_PLASTIC: case Graphic3d_NameOfMaterial_Plastified:
MaterialType = Graphic3d_MATERIAL_ASPECT; MaterialType = Graphic3d_MATERIAL_ASPECT;
Shininess = 0.0078125f; Shininess = 0.0078125f;
@ -102,7 +102,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
BSDF.Normalize(); BSDF.Normalize();
break; break;
case Graphic3d_NOM_SHINY_PLASTIC: case Graphic3d_NameOfMaterial_ShinyPlastified:
MaterialType = Graphic3d_MATERIAL_ASPECT; MaterialType = Graphic3d_MATERIAL_ASPECT;
Shininess = 1.00f; Shininess = 1.00f;
@ -115,7 +115,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
BSDF.Ks = Graphic3d_Vec4 (0.145f, 0.145f, 0.145f, 0.17f); BSDF.Ks = Graphic3d_Vec4 (0.145f, 0.145f, 0.145f, 0.17f);
BSDF.Normalize(); BSDF.Normalize();
break; break;
case Graphic3d_NOM_SATIN: case Graphic3d_NameOfMaterial_Satin:
MaterialType = Graphic3d_MATERIAL_ASPECT; MaterialType = Graphic3d_MATERIAL_ASPECT;
Shininess = 0.09375f; Shininess = 0.09375f;
@ -128,7 +128,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
BSDF.Ks = Graphic3d_Vec4 (0.6f); BSDF.Ks = Graphic3d_Vec4 (0.6f);
break; break;
case Graphic3d_NOM_NEON_GNC: case Graphic3d_NameOfMaterial_Ionized:
MaterialType = Graphic3d_MATERIAL_ASPECT; MaterialType = Graphic3d_MATERIAL_ASPECT;
Shininess = 0.05f; Shininess = 0.05f;
@ -142,7 +142,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
BSDF.Le = static_cast<Graphic3d_Vec3> (Colors[Graphic3d_TOR_DIFFUSE]); BSDF.Le = static_cast<Graphic3d_Vec3> (Colors[Graphic3d_TOR_DIFFUSE]);
BSDF.FresnelBase = Graphic3d_Fresnel::CreateDielectric (1.5f); BSDF.FresnelBase = Graphic3d_Fresnel::CreateDielectric (1.5f);
break; break;
case Graphic3d_NOM_METALIZED: case Graphic3d_NameOfMaterial_Metalized:
MaterialType = Graphic3d_MATERIAL_ASPECT; MaterialType = Graphic3d_MATERIAL_ASPECT;
Shininess = 0.13f; Shininess = 0.13f;
@ -154,7 +154,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f), BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.2f)), 0.045f); Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.2f)), 0.045f);
break; break;
case Graphic3d_NOM_BRASS: case Graphic3d_NameOfMaterial_Brass:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f), BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
@ -166,7 +166,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.992f, 0.941f, 0.808f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.992f, 0.941f, 0.808f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_BRONZE: case Graphic3d_NameOfMaterial_Bronze:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f), BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
@ -178,7 +178,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.590f, 0.408f, 0.250f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.590f, 0.408f, 0.250f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_COPPER: case Graphic3d_NameOfMaterial_Copper:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f), BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
@ -190,7 +190,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.950f, 0.640f, 0.540f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.950f, 0.640f, 0.540f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_GOLD: case Graphic3d_NameOfMaterial_Gold:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f), BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
@ -202,7 +202,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (1.000f, 0.710f, 0.290f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (1.000f, 0.710f, 0.290f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_PEWTER: case Graphic3d_NameOfMaterial_Pewter:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f), BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
@ -214,7 +214,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.333f, 0.333f, 0.522f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.333f, 0.333f, 0.522f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_PLASTER: case Graphic3d_NameOfMaterial_Plastered:
MaterialType = Graphic3d_MATERIAL_ASPECT; MaterialType = Graphic3d_MATERIAL_ASPECT;
Shininess = 0.01f; Shininess = 0.01f;
@ -226,7 +226,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
BSDF.Kd = Graphic3d_Vec3 (0.482353f, 0.482353f, 0.482353f); BSDF.Kd = Graphic3d_Vec3 (0.482353f, 0.482353f, 0.482353f);
break; break;
case Graphic3d_NOM_SILVER: case Graphic3d_NameOfMaterial_Silver:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f), BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
@ -238,7 +238,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.950f, 0.930f, 0.880f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.950f, 0.930f, 0.880f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_STEEL: case Graphic3d_NameOfMaterial_Steel:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f), BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
@ -250,7 +250,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.560f, 0.570f, 0.580f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.560f, 0.570f, 0.580f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_STONE: case Graphic3d_NameOfMaterial_Stone:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
// special case for SetColor() // special case for SetColor()
@ -267,7 +267,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
BSDF.Ks = Graphic3d_Vec4 (0.00392157f, 0.00392157f, 0.00392157f, 0.5f); BSDF.Ks = Graphic3d_Vec4 (0.00392157f, 0.00392157f, 0.00392157f, 0.5f);
break; break;
case Graphic3d_NOM_CHROME: case Graphic3d_NameOfMaterial_Chrome:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f), BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
@ -279,7 +279,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.975f, 0.975f, 0.975f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.975f, 0.975f, 0.975f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_ALUMINIUM: case Graphic3d_NameOfMaterial_Aluminum:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f), BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
@ -291,7 +291,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.910f, 0.920f, 0.920f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.910f, 0.920f, 0.920f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_NEON_PHC: case Graphic3d_NameOfMaterial_Neon:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
Shininess = 0.05f; Shininess = 0.05f;
@ -305,7 +305,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
BSDF.Le = Graphic3d_Vec3 (0.0f, 1.0f, 0.46f); BSDF.Le = Graphic3d_Vec3 (0.0f, 1.0f, 0.46f);
BSDF.FresnelBase = Graphic3d_Fresnel::CreateDielectric (1.5f); BSDF.FresnelBase = Graphic3d_Fresnel::CreateDielectric (1.5f);
break; break;
case Graphic3d_NOM_OBSIDIAN: case Graphic3d_NameOfMaterial_Obsidian:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
Shininess = 0.3f; Shininess = 0.3f;
@ -317,7 +317,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
BSDF.Kd = Graphic3d_Vec3 (0.023f, 0.f, 0.023f); BSDF.Kd = Graphic3d_Vec3 (0.023f, 0.f, 0.023f);
BSDF.Ks = Graphic3d_Vec4 (0.0156863f, 0.0156863f, 0.0156863f, 0.1f); BSDF.Ks = Graphic3d_Vec4 (0.0156863f, 0.0156863f, 0.0156863f, 0.1f);
break; break;
case Graphic3d_NOM_JADE: case Graphic3d_NameOfMaterial_Jade:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
Shininess = 0.10f; Shininess = 0.10f;
@ -330,7 +330,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
BSDF.Kd = Graphic3d_Vec3 (0.208658f, 0.415686f, 0.218401f); BSDF.Kd = Graphic3d_Vec3 (0.208658f, 0.415686f, 0.218401f);
BSDF.Ks = Graphic3d_Vec4 (0.611765f, 0.611765f, 0.611765f, 0.06f); BSDF.Ks = Graphic3d_Vec4 (0.611765f, 0.611765f, 0.611765f, 0.06f);
break; break;
case Graphic3d_NOM_CHARCOAL: case Graphic3d_NameOfMaterial_Charcoal:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
Shininess = 0.01f; Shininess = 0.01f;
@ -342,7 +342,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
BSDF.Kd = Graphic3d_Vec3 (0.02f, 0.02f, 0.02f); BSDF.Kd = Graphic3d_Vec3 (0.02f, 0.02f, 0.02f);
BSDF.Ks = Graphic3d_Vec4 (0.1f, 0.1f, 0.1f, 0.3f); BSDF.Ks = Graphic3d_Vec4 (0.1f, 0.1f, 0.1f, 0.3f);
break; break;
case Graphic3d_NOM_WATER: case Graphic3d_NameOfMaterial_Water:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
RefractionIndex = 1.33f; RefractionIndex = 1.33f;
@ -358,7 +358,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.380f, 0.380f, 0.380f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.380f, 0.380f, 0.380f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_GLASS: case Graphic3d_NameOfMaterial_Glass:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
RefractionIndex = 1.62f; RefractionIndex = 1.62f;
@ -374,7 +374,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.920f, 0.920f, 0.920f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.920f, 0.920f, 0.920f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_DIAMOND: case Graphic3d_NameOfMaterial_Diamond:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
RefractionIndex = 2.42f; RefractionIndex = 2.42f;
@ -391,7 +391,7 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_TRANSPARENT: case Graphic3d_NameOfMaterial_Transparent:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
RefractionIndex = 1.0f; RefractionIndex = 1.0f;
@ -407,14 +407,14 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.970f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.970f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_UserDefined: case Graphic3d_NameOfMaterial_UserDefined:
MaterialType = Graphic3d_MATERIAL_PHYSIC; MaterialType = Graphic3d_MATERIAL_PHYSIC;
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.1f)); Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.1f));
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.6f)); Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.6f));
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.2f)); Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.2f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f)); Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break; break;
case Graphic3d_NOM_DEFAULT: case Graphic3d_NameOfMaterial_DEFAULT:
MaterialType = Graphic3d_MATERIAL_ASPECT; MaterialType = Graphic3d_MATERIAL_ASPECT;
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.15f)); Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.15f));
@ -431,9 +431,9 @@ RawMaterial::RawMaterial (Graphic3d_NameOfMaterial theName, const char* theStrin
// purpose : // purpose :
// ======================================================================= // =======================================================================
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect() Graphic3d_MaterialAspect::Graphic3d_MaterialAspect()
: myRequestedMaterialName (Graphic3d_NOM_DEFAULT) : myRequestedMaterialName (Graphic3d_NameOfMaterial_DEFAULT)
{ {
init (Graphic3d_NOM_DEFAULT); init (Graphic3d_NameOfMaterial_DEFAULT);
} }
// ======================================================================= // =======================================================================
@ -511,7 +511,7 @@ void Graphic3d_MaterialAspect::SetColor (const Quantity_Color& theColor)
const RawMaterial& aSrcMat = THE_MATERIALS[myRequestedMaterialName]; const RawMaterial& aSrcMat = THE_MATERIALS[myRequestedMaterialName];
const Quantity_Color anAmbient((Graphic3d_Vec3 )theColor * aSrcMat.AmbientCoef); const Quantity_Color anAmbient((Graphic3d_Vec3 )theColor * aSrcMat.AmbientCoef);
const Quantity_Color aDiffuse ((Graphic3d_Vec3 )theColor * aSrcMat.DiffuseCoef); const Quantity_Color aDiffuse ((Graphic3d_Vec3 )theColor * aSrcMat.DiffuseCoef);
if (myMaterialName != Graphic3d_NOM_UserDefined if (myMaterialName != Graphic3d_NameOfMaterial_UserDefined
&& (!myColors[Graphic3d_TOR_AMBIENT].IsEqual (anAmbient) && (!myColors[Graphic3d_TOR_AMBIENT].IsEqual (anAmbient)
|| !myColors[Graphic3d_TOR_DIFFUSE].IsEqual (aDiffuse))) || !myColors[Graphic3d_TOR_DIFFUSE].IsEqual (aDiffuse)))
{ {
@ -528,7 +528,7 @@ void Graphic3d_MaterialAspect::SetColor (const Quantity_Color& theColor)
void Graphic3d_MaterialAspect::SetAmbientColor (const Quantity_Color& theColor) void Graphic3d_MaterialAspect::SetAmbientColor (const Quantity_Color& theColor)
{ {
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
&& myMaterialName != Graphic3d_NOM_UserDefined && myMaterialName != Graphic3d_NameOfMaterial_UserDefined
&& !myColors[Graphic3d_TOR_AMBIENT].IsEqual (theColor)) && !myColors[Graphic3d_TOR_AMBIENT].IsEqual (theColor))
{ {
setUserMaterial(); setUserMaterial();
@ -543,7 +543,7 @@ void Graphic3d_MaterialAspect::SetAmbientColor (const Quantity_Color& theColor)
void Graphic3d_MaterialAspect::SetDiffuseColor (const Quantity_Color& theColor) void Graphic3d_MaterialAspect::SetDiffuseColor (const Quantity_Color& theColor)
{ {
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
&& myMaterialName != Graphic3d_NOM_UserDefined && myMaterialName != Graphic3d_NameOfMaterial_UserDefined
&& !myColors[Graphic3d_TOR_DIFFUSE].IsEqual (theColor)) && !myColors[Graphic3d_TOR_DIFFUSE].IsEqual (theColor))
{ {
setUserMaterial(); setUserMaterial();
@ -558,7 +558,7 @@ void Graphic3d_MaterialAspect::SetDiffuseColor (const Quantity_Color& theColor)
void Graphic3d_MaterialAspect::SetSpecularColor (const Quantity_Color& theColor) void Graphic3d_MaterialAspect::SetSpecularColor (const Quantity_Color& theColor)
{ {
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
&& myMaterialName != Graphic3d_NOM_UserDefined && myMaterialName != Graphic3d_NameOfMaterial_UserDefined
&& !myColors[Graphic3d_TOR_SPECULAR].IsEqual (theColor)) && !myColors[Graphic3d_TOR_SPECULAR].IsEqual (theColor))
{ {
setUserMaterial(); setUserMaterial();
@ -573,7 +573,7 @@ void Graphic3d_MaterialAspect::SetSpecularColor (const Quantity_Color& theColor)
void Graphic3d_MaterialAspect::SetEmissiveColor (const Quantity_Color& theColor) void Graphic3d_MaterialAspect::SetEmissiveColor (const Quantity_Color& theColor)
{ {
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
&& myMaterialName != Graphic3d_NOM_UserDefined && myMaterialName != Graphic3d_NameOfMaterial_UserDefined
&& !myColors[Graphic3d_TOR_EMISSION].IsEqual (theColor)) && !myColors[Graphic3d_TOR_EMISSION].IsEqual (theColor))
{ {
setUserMaterial(); setUserMaterial();
@ -668,32 +668,32 @@ Standard_Boolean Graphic3d_MaterialAspect::MaterialFromName (const Standard_CStr
// parse aliases // parse aliases
if (aName == "Plastic") // Plastified if (aName == "Plastic") // Plastified
{ {
theMat = Graphic3d_NOM_PLASTIC; theMat = Graphic3d_NameOfMaterial_Plastified;
return Standard_True; return Standard_True;
} }
else if (aName == "Shiny_plastic") // Shiny_plastified else if (aName == "Shiny_plastic") // Shiny_plastified
{ {
theMat = Graphic3d_NOM_SHINY_PLASTIC; theMat = Graphic3d_NameOfMaterial_ShinyPlastified;
return Standard_True; return Standard_True;
} }
else if (aName == "Plaster") // Plastered else if (aName == "Plaster") // Plastered
{ {
theMat = Graphic3d_NOM_PLASTER; theMat = Graphic3d_NameOfMaterial_Plastered;
return Standard_True; return Standard_True;
} }
else if (aName == "Satin") // Satined else if (aName == "Satin") // Satined
{ {
theMat = Graphic3d_NOM_SATIN; theMat = Graphic3d_NameOfMaterial_Satin;
return Standard_True; return Standard_True;
} }
else if (aName == "Neon_gnc") // Ionized else if (aName == "Neon_gnc") // Ionized
{ {
theMat = Graphic3d_NOM_NEON_GNC; theMat = Graphic3d_NameOfMaterial_Ionized;
return Standard_True; return Standard_True;
} }
else if (aName == "Neon_phc") // Neon else if (aName == "Neon_phc") // Neon
{ {
theMat = Graphic3d_NOM_NEON_PHC; theMat = Graphic3d_NameOfMaterial_Neon;
return Standard_True; return Standard_True;
} }
return Standard_False; return Standard_False;

View File

@ -35,7 +35,7 @@ public:
DEFINE_STANDARD_ALLOC DEFINE_STANDARD_ALLOC
//! Returns the number of predefined textures. //! Returns the number of predefined textures.
static Standard_Integer NumberOfMaterials() { return Graphic3d_NOM_DEFAULT; } static Standard_Integer NumberOfMaterials() { return Graphic3d_NameOfMaterial_DEFAULT; }
//! Returns the name of the predefined material of specified rank within range [1, NumberOfMaterials()]. //! Returns the name of the predefined material of specified rank within range [1, NumberOfMaterials()].
Standard_EXPORT static Standard_CString MaterialName (const Standard_Integer theRank); Standard_EXPORT static Standard_CString MaterialName (const Standard_Integer theRank);
@ -50,10 +50,10 @@ public:
Standard_EXPORT static Standard_Boolean MaterialFromName (const Standard_CString theName, Standard_EXPORT static Standard_Boolean MaterialFromName (const Standard_CString theName,
Graphic3d_NameOfMaterial& theMat); Graphic3d_NameOfMaterial& theMat);
//! Returns the material for specified name or Graphic3d_NOM_DEFAULT if name is unknown. //! Returns the material for specified name or Graphic3d_NameOfMaterial_DEFAULT if name is unknown.
static Graphic3d_NameOfMaterial MaterialFromName (const Standard_CString theName) static Graphic3d_NameOfMaterial MaterialFromName (const Standard_CString theName)
{ {
Graphic3d_NameOfMaterial aMat = Graphic3d_NOM_DEFAULT; Graphic3d_NameOfMaterial aMat = Graphic3d_NameOfMaterial_DEFAULT;
MaterialFromName (theName, aMat); MaterialFromName (theName, aMat);
return aMat; return aMat;
} }
@ -87,7 +87,7 @@ public:
{ {
// if a component of a "standard" material change, the // if a component of a "standard" material change, the
// result is no more standard (a blue gold is not a gold) // result is no more standard (a blue gold is not a gold)
myMaterialName = Graphic3d_NOM_UserDefined; myMaterialName = Graphic3d_NameOfMaterial_UserDefined;
myStringName = theName; myStringName = theName;
} }
@ -248,9 +248,9 @@ private:
{ {
// if a component of a "standard" material change, the // if a component of a "standard" material change, the
// result is no more standard (a blue gold is not a gold) // result is no more standard (a blue gold is not a gold)
if (myMaterialName != Graphic3d_NOM_UserDefined) if (myMaterialName != Graphic3d_NameOfMaterial_UserDefined)
{ {
myMaterialName = Graphic3d_NOM_UserDefined; myMaterialName = Graphic3d_NameOfMaterial_UserDefined;
myStringName = "UserDefined"; myStringName = "UserDefined";
} }
} }

View File

@ -17,35 +17,66 @@
#ifndef _Graphic3d_NameOfMaterial_HeaderFile #ifndef _Graphic3d_NameOfMaterial_HeaderFile
#define _Graphic3d_NameOfMaterial_HeaderFile #define _Graphic3d_NameOfMaterial_HeaderFile
//! Types of aspect materials. //! List of named materials (predefined presets).
//! Each preset defines either physical (having natural color) or generic (mutable color) material (@sa Graphic3d_TypeOfMaterial).
enum Graphic3d_NameOfMaterial enum Graphic3d_NameOfMaterial
{ {
Graphic3d_NOM_BRASS, Graphic3d_NameOfMaterial_Brass, //!< Brass (Physic)
Graphic3d_NOM_BRONZE, Graphic3d_NameOfMaterial_Bronze, //!< Bronze (Physic)
Graphic3d_NOM_COPPER, Graphic3d_NameOfMaterial_Copper, //!< Copper (Physic)
Graphic3d_NOM_GOLD, Graphic3d_NameOfMaterial_Gold, //!< Gold (Physic)
Graphic3d_NOM_PEWTER, Graphic3d_NameOfMaterial_Pewter, //!< Pewter (Physic)
Graphic3d_NOM_PLASTER, Graphic3d_NameOfMaterial_Plastered, //!< Plastered (Generic)
Graphic3d_NOM_PLASTIC, Graphic3d_NameOfMaterial_Plastified, //!< Plastified (Generic)
Graphic3d_NOM_SILVER, Graphic3d_NameOfMaterial_Silver, //!< Silver (Physic)
Graphic3d_NOM_STEEL, Graphic3d_NameOfMaterial_Steel, //!< Steel (Physic)
Graphic3d_NOM_STONE, Graphic3d_NameOfMaterial_Stone, //!< Stone (Physic)
Graphic3d_NOM_SHINY_PLASTIC, Graphic3d_NameOfMaterial_ShinyPlastified, //!< Shiny Plastified (Generic)
Graphic3d_NOM_SATIN, Graphic3d_NameOfMaterial_Satin, //!< Satin (Generic)
Graphic3d_NOM_METALIZED, Graphic3d_NameOfMaterial_Metalized, //!< Metalized (Generic)
Graphic3d_NOM_NEON_GNC, Graphic3d_NameOfMaterial_Ionized, //!< Ionized (Generic)
Graphic3d_NOM_CHROME, Graphic3d_NameOfMaterial_Chrome, //!< Chrome (Physic)
Graphic3d_NOM_ALUMINIUM, Graphic3d_NameOfMaterial_Aluminum, //!< Aluminum (Physic)
Graphic3d_NOM_OBSIDIAN, Graphic3d_NameOfMaterial_Obsidian, //!< Obsidian (Physic)
Graphic3d_NOM_NEON_PHC, Graphic3d_NameOfMaterial_Neon, //!< Neon (Physic)
Graphic3d_NOM_JADE, Graphic3d_NameOfMaterial_Jade, //!< Jade (Physic)
Graphic3d_NOM_CHARCOAL, Graphic3d_NameOfMaterial_Charcoal, //!< Charcoal (Physic)
Graphic3d_NOM_WATER, Graphic3d_NameOfMaterial_Water, //!< Water (Physic)
Graphic3d_NOM_GLASS, Graphic3d_NameOfMaterial_Glass, //!< Glass (Physic)
Graphic3d_NOM_DIAMOND, Graphic3d_NameOfMaterial_Diamond, //!< Diamond (Physic)
Graphic3d_NOM_TRANSPARENT, Graphic3d_NameOfMaterial_Transparent, //!< Transparent (Physic)
Graphic3d_NOM_DEFAULT, Graphic3d_NameOfMaterial_DEFAULT, //!< Default (Generic);
Graphic3d_NOM_UserDefined //! normally used as out-of-range value pointing to some application default
Graphic3d_NameOfMaterial_UserDefined, //!< User-defined (Physic);
//! used for any material with non-standard definition
// old aliases
Graphic3d_NOM_BRASS = Graphic3d_NameOfMaterial_Brass,
Graphic3d_NOM_BRONZE = Graphic3d_NameOfMaterial_Bronze,
Graphic3d_NOM_COPPER = Graphic3d_NameOfMaterial_Copper,
Graphic3d_NOM_GOLD = Graphic3d_NameOfMaterial_Gold,
Graphic3d_NOM_PEWTER = Graphic3d_NameOfMaterial_Pewter,
Graphic3d_NOM_PLASTER = Graphic3d_NameOfMaterial_Plastered,
Graphic3d_NOM_PLASTIC = Graphic3d_NameOfMaterial_Plastified,
Graphic3d_NOM_SILVER = Graphic3d_NameOfMaterial_Silver,
Graphic3d_NOM_STEEL = Graphic3d_NameOfMaterial_Steel,
Graphic3d_NOM_STONE = Graphic3d_NameOfMaterial_Stone,
Graphic3d_NOM_SHINY_PLASTIC = Graphic3d_NameOfMaterial_ShinyPlastified,
Graphic3d_NOM_SATIN = Graphic3d_NameOfMaterial_Satin,
Graphic3d_NOM_METALIZED = Graphic3d_NameOfMaterial_Metalized,
Graphic3d_NOM_NEON_GNC = Graphic3d_NameOfMaterial_Ionized,
Graphic3d_NOM_CHROME = Graphic3d_NameOfMaterial_Chrome,
Graphic3d_NOM_ALUMINIUM = Graphic3d_NameOfMaterial_Aluminum,
Graphic3d_NOM_OBSIDIAN = Graphic3d_NameOfMaterial_Obsidian,
Graphic3d_NOM_NEON_PHC = Graphic3d_NameOfMaterial_Neon,
Graphic3d_NOM_JADE = Graphic3d_NameOfMaterial_Jade,
Graphic3d_NOM_CHARCOAL = Graphic3d_NameOfMaterial_Charcoal,
Graphic3d_NOM_WATER = Graphic3d_NameOfMaterial_Water,
Graphic3d_NOM_GLASS = Graphic3d_NameOfMaterial_Glass,
Graphic3d_NOM_DIAMOND = Graphic3d_NameOfMaterial_Diamond,
Graphic3d_NOM_TRANSPARENT = Graphic3d_NameOfMaterial_Transparent,
Graphic3d_NOM_DEFAULT = Graphic3d_NameOfMaterial_DEFAULT,
Graphic3d_NOM_UserDefined = Graphic3d_NameOfMaterial_UserDefined
}; };
#endif // _Graphic3d_NameOfMaterial_HeaderFile #endif // _Graphic3d_NameOfMaterial_HeaderFile

View File

@ -215,7 +215,7 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
PolygonVerticesFor3D, PolygonBoundsFor3D ); PolygonVerticesFor3D, PolygonBoundsFor3D );
} }
Graphic3d_MaterialAspect aMaterial[2] = { Graphic3d_NOM_PLASTIC, Graphic3d_NOM_PLASTIC }; Graphic3d_MaterialAspect aMaterial[2] = { Graphic3d_NameOfMaterial_Plastified, Graphic3d_NameOfMaterial_Plastified };
for (Standard_Integer i = 0; i < 2; i++) for (Standard_Integer i = 0; i < 2; i++)
{ {
// OCC20644 "plastic" is most suitable here, as it is "non-physic" // OCC20644 "plastic" is most suitable here, as it is "non-physic"
@ -478,7 +478,7 @@ void MeshVS_ElementalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)&
CustomBuild(Prs, aCustomElements, IDsToExclude, DisplayMode); CustomBuild(Prs, aCustomElements, IDsToExclude, DisplayMode);
} }
Graphic3d_MaterialAspect aMaterial2[2] = { Graphic3d_NOM_PLASTIC, Graphic3d_NOM_PLASTIC }; Graphic3d_MaterialAspect aMaterial2[2] = { Graphic3d_NameOfMaterial_Plastified, Graphic3d_NameOfMaterial_Plastified };
for (Standard_Integer i = 0; i < 2; i++) for (Standard_Integer i = 0; i < 2; i++)
{ {
// OCC20644 "plastic" is most suitable here, as it is "non-physic" // OCC20644 "plastic" is most suitable here, as it is "non-physic"

View File

@ -82,7 +82,7 @@ MeshVS_Mesh::MeshVS_Mesh (const Standard_Boolean theIsAllowOverlapped )
SetHilightMode( MeshVS_DMF_WireFrame ); // Wireframe as default hilight mode SetHilightMode( MeshVS_DMF_WireFrame ); // Wireframe as default hilight mode
SetColor ( Quantity_NOC_WHITE ); SetColor ( Quantity_NOC_WHITE );
SetMaterial ( Graphic3d_NOM_PLASTIC ); SetMaterial (Graphic3d_NameOfMaterial_Plastified);
myCurrentDrawer = new MeshVS_Drawer(); myCurrentDrawer = new MeshVS_Drawer();
myCurrentDrawer->SetColor ( MeshVS_DA_InteriorColor, Quantity_NOC_BLUE4 ); myCurrentDrawer->SetColor ( MeshVS_DA_InteriorColor, Quantity_NOC_BLUE4 );
@ -123,8 +123,8 @@ MeshVS_Mesh::MeshVS_Mesh (const Standard_Boolean theIsAllowOverlapped )
myHilightDrawer->SetColor ( MeshVS_DA_EdgeColor, Quantity_NOC_GREEN ); myHilightDrawer->SetColor ( MeshVS_DA_EdgeColor, Quantity_NOC_GREEN );
myHilightDrawer->SetInteger ( MeshVS_DA_EdgeType, Aspect_TOL_SOLID ); myHilightDrawer->SetInteger ( MeshVS_DA_EdgeType, Aspect_TOL_SOLID );
myHilightDrawer->SetDouble ( MeshVS_DA_EdgeWidth, 1.0 ); myHilightDrawer->SetDouble ( MeshVS_DA_EdgeWidth, 1.0 );
myHilightDrawer->SetMaterial ( MeshVS_DA_FrontMaterial, Graphic3d_NOM_PLASTIC ); myHilightDrawer->SetMaterial ( MeshVS_DA_FrontMaterial, Graphic3d_NameOfMaterial_Plastified );
myHilightDrawer->SetMaterial ( MeshVS_DA_BackMaterial, Graphic3d_NOM_PLASTIC ); myHilightDrawer->SetMaterial ( MeshVS_DA_BackMaterial, Graphic3d_NameOfMaterial_Plastified );
myHilightDrawer->SetColor ( MeshVS_DA_BeamColor, Quantity_NOC_GRAY80 ); myHilightDrawer->SetColor ( MeshVS_DA_BeamColor, Quantity_NOC_GRAY80 );
myHilightDrawer->SetInteger ( MeshVS_DA_BeamType, Aspect_TOL_SOLID ); myHilightDrawer->SetInteger ( MeshVS_DA_BeamType, Aspect_TOL_SOLID );

View File

@ -189,7 +189,7 @@ void MeshVS_NodalColorPrsBuilder::Build ( const Handle(Prs3d_Presentation)& Prs,
// Draw faces with nodal color // Draw faces with nodal color
// OCC20644 Use "plastic" material as it is "non-physic" and so it is easier to get the required colors // OCC20644 Use "plastic" material as it is "non-physic" and so it is easier to get the required colors
Graphic3d_MaterialAspect aMaterial[2] = { Graphic3d_NOM_PLASTIC, Graphic3d_NOM_PLASTIC }; Graphic3d_MaterialAspect aMaterial[2] = { Graphic3d_NameOfMaterial_Plastified, Graphic3d_NameOfMaterial_Plastified };
for (Standard_Integer i = 0; i < 2; ++i) for (Standard_Integer i = 0; i < 2; ++i)
{ {
aMaterial[i].SetSpecularColor (Quantity_NOC_BLACK); aMaterial[i].SetSpecularColor (Quantity_NOC_BLACK);

View File

@ -96,10 +96,10 @@ Handle( Graphic3d_AspectFillArea3d ) MeshVS_Tool::CreateAspectFillArea3d
( const Handle(MeshVS_Drawer)& theDr, ( const Handle(MeshVS_Drawer)& theDr,
const Standard_Boolean UseDefaults ) const Standard_Boolean UseDefaults )
{ {
Graphic3d_MaterialAspect aFrMat = Graphic3d_NOM_BRASS; Graphic3d_MaterialAspect aFrMat = Graphic3d_NameOfMaterial_Brass;
Graphic3d_MaterialAspect aBackMat = Graphic3d_NOM_BRASS; Graphic3d_MaterialAspect aBackMat = Graphic3d_NameOfMaterial_Brass;
Standard_Integer aFrMatI = (Standard_Integer)Graphic3d_NOM_BRASS; Standard_Integer aFrMatI = (Standard_Integer)Graphic3d_NameOfMaterial_Brass;
Standard_Integer aBackMatI = (Standard_Integer)Graphic3d_NOM_BRASS; Standard_Integer aBackMatI = (Standard_Integer)Graphic3d_NameOfMaterial_Brass;
if ( !theDr->GetInteger ( MeshVS_DA_FrontMaterial, aFrMatI ) && !UseDefaults ) if ( !theDr->GetInteger ( MeshVS_DA_FrontMaterial, aFrMatI ) && !UseDefaults )
return 0; return 0;

View File

@ -402,7 +402,7 @@ public:
//! Returns settings for shading aspects. //! Returns settings for shading aspects.
//! These settings can be edited. The default values are: //! These settings can be edited. The default values are:
//! - Color: Quantity_NOC_YELLOW //! - Color: Quantity_NOC_YELLOW
//! - Material: Graphic3d_NOM_BRASS //! - Material: Graphic3d_NameOfMaterial_Brass
//! Shading aspect is obtained through decomposition of //! Shading aspect is obtained through decomposition of
//! 3d faces into triangles, each side of each triangle //! 3d faces into triangles, each side of each triangle
//! being a chord of the corresponding curved edge in the face. //! being a chord of the corresponding curved edge in the face.

View File

@ -28,7 +28,7 @@ IMPLEMENT_STANDARD_RTTIEXT(Prs3d_ShadingAspect, Prs3d_BasicAspect)
//======================================================================= //=======================================================================
Prs3d_ShadingAspect::Prs3d_ShadingAspect() Prs3d_ShadingAspect::Prs3d_ShadingAspect()
{ {
const Graphic3d_MaterialAspect aMat (Graphic3d_NOM_BRASS); const Graphic3d_MaterialAspect aMat (Graphic3d_NameOfMaterial_Brass);
const Quantity_Color aColor = aMat.AmbientColor(); const Quantity_Color aColor = aMat.AmbientColor();
myAspect = new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID, myAspect = new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID,
aColor, aColor,

View File

@ -509,7 +509,7 @@ void PrsDim_Dimension::drawText (const Handle(Prs3d_Presentation)& thePresentati
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect()); myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
} }
Graphic3d_MaterialAspect aShadeMat (Graphic3d_NOM_DEFAULT); Graphic3d_MaterialAspect aShadeMat (Graphic3d_NameOfMaterial_DEFAULT);
aShadeMat.SetAmbientColor (Quantity_NOC_BLACK); aShadeMat.SetAmbientColor (Quantity_NOC_BLACK);
aShadeMat.SetDiffuseColor (Quantity_NOC_BLACK); aShadeMat.SetDiffuseColor (Quantity_NOC_BLACK);
aShadeMat.SetSpecularColor(Quantity_NOC_BLACK); aShadeMat.SetSpecularColor(Quantity_NOC_BLACK);

View File

@ -124,7 +124,7 @@ static Standard_Integer OCC128 (Draw_Interpretor& di, Standard_Integer /*argc*/
TopoDS_Shape shape1 = BRepPrimAPI_MakeBox(50,50,50).Shape(); TopoDS_Shape shape1 = BRepPrimAPI_MakeBox(50,50,50).Shape();
Handle(AIS_Shape) AS = new AIS_Shape(shape1); Handle(AIS_Shape) AS = new AIS_Shape(shape1);
AS->SetDisplayMode(1); AS->SetDisplayMode(1);
Graphic3d_MaterialAspect mat(Graphic3d_NOM_PLASTIC); Graphic3d_MaterialAspect mat (Graphic3d_NameOfMaterial_Plastified);
AS->SetMaterial(mat); AS->SetMaterial(mat);
AS->SetColor(Quantity_NOC_RED); AS->SetColor(Quantity_NOC_RED);
myAISContext->Display (AS, Standard_False); myAISContext->Display (AS, Standard_False);

View File

@ -1159,7 +1159,7 @@ static Standard_Integer OCC1174_2 (Draw_Interpretor& di, Standard_Integer argc,
Handle(AIS_Shape) ais = new AIS_Shape(sh); Handle(AIS_Shape) ais = new AIS_Shape(sh);
AISContext->Display (ais, 1, 0, Standard_False); AISContext->Display (ais, 1, 0, Standard_False);
AISContext->SetMaterial (ais, Graphic3d_NOM_SHINY_PLASTIC, Standard_False); AISContext->SetMaterial (ais, Graphic3d_NameOfMaterial_ShinyPlastified, Standard_False);
Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_sRGB); Quantity_Color colf(0.0, 0.4, 0.0, Quantity_TOC_sRGB);
Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_sRGB); Quantity_Color colb(0.0, 0.0, 0.6, Quantity_TOC_sRGB);

View File

@ -310,7 +310,7 @@ static Standard_Integer BUC60811(Draw_Interpretor& di, Standard_Integer argc, co
TopoDS_Face F1= bzf1.Face(); TopoDS_Face F1= bzf1.Face();
ais1 = new AIS_Shape(F1); ais1 = new AIS_Shape(F1);
DBRep::Set("F1",F1); DBRep::Set("F1",F1);
aContext->SetMaterial(ais1,Graphic3d_NOM_ALUMINIUM,Standard_False); aContext->SetMaterial (ais1, Graphic3d_NameOfMaterial_Aluminum, Standard_False);
aContext->Display (ais1, Standard_False); aContext->Display (ais1, Standard_False);
BRep_Builder B; BRep_Builder B;
TopoDS_Shell shell; TopoDS_Shell shell;
@ -347,7 +347,7 @@ static Standard_Integer BUC60811(Draw_Interpretor& di, Standard_Integer argc, co
mkw.Add(*E6); mkw.Add(*E6);
FP = BRepBuilderAPI_MakeFace(mkw.Wire()); FP = BRepBuilderAPI_MakeFace(mkw.Wire());
ais2 = new AIS_Shape( FP ); ais2 = new AIS_Shape( FP );
aContext->SetMaterial(ais2,Graphic3d_NOM_ALUMINIUM,Standard_False); aContext->SetMaterial (ais2, Graphic3d_NameOfMaterial_Aluminum, Standard_False);
aContext->Display (ais2, Standard_False); aContext->Display (ais2, Standard_False);
DBRep::Set("FP",FP); DBRep::Set("FP",FP);
@ -378,7 +378,7 @@ static Standard_Integer BUC60811(Draw_Interpretor& di, Standard_Integer argc, co
fillet.Build(); fillet.Build();
FP1 = fillet.Shape(); FP1 = fillet.Shape();
ais2 = new AIS_Shape( FP1 ); ais2 = new AIS_Shape( FP1 );
aContext->SetMaterial(ais2,Graphic3d_NOM_ALUMINIUM,Standard_False); aContext->SetMaterial (ais2, Graphic3d_NameOfMaterial_Aluminum, Standard_False);
aContext->Display (ais2, Standard_False); aContext->Display (ais2, Standard_False);
DBRep::Set("FP1",FP1); DBRep::Set("FP1",FP1);

View File

@ -66,7 +66,7 @@ void V3d_Plane::Display (const Handle(V3d_View)& theView,
myGraphicStructure = new Graphic3d_Structure (aViewer->StructureManager()); myGraphicStructure = new Graphic3d_Structure (aViewer->StructureManager());
Handle(Graphic3d_Group) aGroup = myGraphicStructure->NewGroup(); Handle(Graphic3d_Group) aGroup = myGraphicStructure->NewGroup();
Handle(Graphic3d_AspectFillArea3d) anAsp = new Graphic3d_AspectFillArea3d(); Handle(Graphic3d_AspectFillArea3d) anAsp = new Graphic3d_AspectFillArea3d();
Graphic3d_MaterialAspect aPlastic (Graphic3d_NOM_PLASTIC); Graphic3d_MaterialAspect aPlastic (Graphic3d_NameOfMaterial_Plastified);
aPlastic.SetColor (theColor); aPlastic.SetColor (theColor);
aPlastic.SetTransparency (0.5); aPlastic.SetTransparency (0.5);
anAsp->SetFrontMaterial (aPlastic); anAsp->SetFrontMaterial (aPlastic);

View File

@ -82,7 +82,7 @@ extern int ViewerMainLoop(Standard_Integer argc, const char** argv);
#define DEFAULT_COLOR Quantity_NOC_GOLDENROD #define DEFAULT_COLOR Quantity_NOC_GOLDENROD
#define DEFAULT_FREEBOUNDARY_COLOR Quantity_NOC_GREEN #define DEFAULT_FREEBOUNDARY_COLOR Quantity_NOC_GREEN
#define DEFAULT_MATERIAL Graphic3d_NOM_BRASS #define DEFAULT_MATERIAL Graphic3d_NameOfMaterial_Brass
//======================================================================= //=======================================================================
// function : GetColorFromName // function : GetColorFromName
@ -1769,7 +1769,7 @@ struct ViewerTest_AspectsChangeSet
AlphaMode (Graphic3d_AlphaMode_BlendAuto), AlphaMode (Graphic3d_AlphaMode_BlendAuto),
AlphaCutoff (0.5f), AlphaCutoff (0.5f),
ToSetMaterial (0), ToSetMaterial (0),
Material (Graphic3d_NOM_DEFAULT), Material (Graphic3d_NameOfMaterial_DEFAULT),
ToSetShowFreeBoundary (0), ToSetShowFreeBoundary (0),
ToSetFreeBoundaryWidth (0), ToSetFreeBoundaryWidth (0),
FreeBoundaryWidth (1.0), FreeBoundaryWidth (1.0),
@ -2807,7 +2807,7 @@ static Standard_Integer VAspects (Draw_Interpretor& theDI,
|| anArg == "-unsetmaterial") || anArg == "-unsetmaterial")
{ {
aChangeSet->ToSetMaterial = -1; aChangeSet->ToSetMaterial = -1;
aChangeSet->Material = Graphic3d_NOM_DEFAULT; aChangeSet->Material = Graphic3d_NameOfMaterial_DEFAULT;
} }
else if (anArg == "-subshape" else if (anArg == "-subshape"
|| anArg == "-subshapes") || anArg == "-subshapes")
@ -3187,7 +3187,7 @@ static Standard_Integer VAspects (Draw_Interpretor& theDI,
//aChangeSet->ToSetBackFaceColor = -1; // should be reset by ToSetColor //aChangeSet->ToSetBackFaceColor = -1; // should be reset by ToSetColor
//aChangeSet->BackFaceColor = DEFAULT_COLOR; //aChangeSet->BackFaceColor = DEFAULT_COLOR;
aChangeSet->ToSetMaterial = -1; aChangeSet->ToSetMaterial = -1;
aChangeSet->Material = Graphic3d_NOM_DEFAULT; aChangeSet->Material = Graphic3d_NameOfMaterial_DEFAULT;
aChangeSet->ToSetShowFreeBoundary = -1; aChangeSet->ToSetShowFreeBoundary = -1;
aChangeSet->ToSetFreeBoundaryColor = -1; aChangeSet->ToSetFreeBoundaryColor = -1;
aChangeSet->FreeBoundaryColor = DEFAULT_FREEBOUNDARY_COLOR; aChangeSet->FreeBoundaryColor = DEFAULT_FREEBOUNDARY_COLOR;

View File

@ -3053,7 +3053,7 @@ static int VDrawSphere (Draw_Interpretor& /*di*/, Standard_Integer argc, const c
} }
// Setting material properties, very important for desirable visual result! // Setting material properties, very important for desirable visual result!
Graphic3d_MaterialAspect aMat (Graphic3d_NOM_PLASTIC); Graphic3d_MaterialAspect aMat (Graphic3d_NameOfMaterial_Plastified);
aMat.SetAmbientColor (Quantity_Color (Graphic3d_Vec3 (0.04f))); aMat.SetAmbientColor (Quantity_Color (Graphic3d_Vec3 (0.04f)));
aMat.SetSpecularColor(Quantity_Color (Graphic3d_Vec3 (0.50f))); aMat.SetSpecularColor(Quantity_Color (Graphic3d_Vec3 (0.50f)));
Handle(Graphic3d_AspectFillArea3d) anAspect Handle(Graphic3d_AspectFillArea3d) anAspect

View File

@ -923,13 +923,13 @@ static Standard_Integer VListMaterials (Draw_Interpretor& theDI,
TCollection_AsciiString anArg (theArgVec[anArgIter]); TCollection_AsciiString anArg (theArgVec[anArgIter]);
anArg.LowerCase(); anArg.LowerCase();
Graphic3d_NameOfMaterial aMat = Graphic3d_MaterialAspect::MaterialFromName (theArgVec[anArgIter]); Graphic3d_NameOfMaterial aMat = Graphic3d_MaterialAspect::MaterialFromName (theArgVec[anArgIter]);
if (aMat != Graphic3d_NOM_DEFAULT) if (aMat != Graphic3d_NameOfMaterial_DEFAULT)
{ {
aMatList.Append (aMat); aMatList.Append (aMat);
} }
else if (anArg == "*") else if (anArg == "*")
{ {
for (Standard_Integer aMatIter = 0; aMatIter < (Standard_Integer )Graphic3d_NOM_DEFAULT; ++aMatIter) for (Standard_Integer aMatIter = 0; aMatIter < (Standard_Integer )Graphic3d_NameOfMaterial_DEFAULT; ++aMatIter)
{ {
aMatList.Append ((Graphic3d_NameOfMaterial )aMatIter); aMatList.Append ((Graphic3d_NameOfMaterial )aMatIter);
} }
@ -959,7 +959,7 @@ static Standard_Integer VListMaterials (Draw_Interpretor& theDI,
return 0; return 0;
} }
for (Standard_Integer aMatIter = 0; aMatIter < (Standard_Integer )Graphic3d_NOM_DEFAULT; ++aMatIter) for (Standard_Integer aMatIter = 0; aMatIter < (Standard_Integer )Graphic3d_NameOfMaterial_DEFAULT; ++aMatIter)
{ {
aMatList.Append ((Graphic3d_NameOfMaterial )aMatIter); aMatList.Append ((Graphic3d_NameOfMaterial )aMatIter);
} }

View File

@ -13453,7 +13453,7 @@ static int VSelectionProperties (Draw_Interpretor& theDi,
const Handle(Prs3d_Drawer)& aStyle = aCtx->HighlightStyle (aType); const Handle(Prs3d_Drawer)& aStyle = aCtx->HighlightStyle (aType);
Graphic3d_NameOfMaterial aMatName = Graphic3d_MaterialAspect::MaterialFromName (theArgVec[anArgIter + 1]); Graphic3d_NameOfMaterial aMatName = Graphic3d_MaterialAspect::MaterialFromName (theArgVec[anArgIter + 1]);
if (aMatName != Graphic3d_NOM_DEFAULT) if (aMatName != Graphic3d_NameOfMaterial_DEFAULT)
{ {
++anArgIter; ++anArgIter;
Handle(Graphic3d_AspectFillArea3d) anAspect = new Graphic3d_AspectFillArea3d(); Handle(Graphic3d_AspectFillArea3d) anAspect = new Graphic3d_AspectFillArea3d();

View File

@ -200,7 +200,7 @@ void XCAFDoc_VisMaterial::FillMaterialAspect (Graphic3d_MaterialAspect& theAspec
{ {
if (myCommonMat.IsDefined) if (myCommonMat.IsDefined)
{ {
theAspect = Graphic3d_MaterialAspect (Graphic3d_NOM_UserDefined); theAspect = Graphic3d_MaterialAspect (Graphic3d_NameOfMaterial_UserDefined);
theAspect.SetAmbientColor (myCommonMat.AmbientColor); theAspect.SetAmbientColor (myCommonMat.AmbientColor);
theAspect.SetDiffuseColor (myCommonMat.DiffuseColor); theAspect.SetDiffuseColor (myCommonMat.DiffuseColor);
theAspect.SetSpecularColor(myCommonMat.SpecularColor); theAspect.SetSpecularColor(myCommonMat.SpecularColor);
@ -225,7 +225,7 @@ void XCAFDoc_VisMaterial::FillMaterialAspect (Graphic3d_MaterialAspect& theAspec
if (!myCommonMat.IsDefined) if (!myCommonMat.IsDefined)
{ {
// convert metal-roughness into common // convert metal-roughness into common
theAspect = Graphic3d_MaterialAspect (Graphic3d_NOM_UserDefined); theAspect = Graphic3d_MaterialAspect (Graphic3d_NameOfMaterial_UserDefined);
theAspect.SetDiffuseColor (myPbrMat.BaseColor.GetRGB()); theAspect.SetDiffuseColor (myPbrMat.BaseColor.GetRGB());
theAspect.SetAlpha (myPbrMat.BaseColor.Alpha()); theAspect.SetAlpha (myPbrMat.BaseColor.Alpha());
theAspect.SetSpecularColor(Quantity_Color (Graphic3d_Vec3 (myPbrMat.Metallic))); theAspect.SetSpecularColor(Quantity_Color (Graphic3d_Vec3 (myPbrMat.Metallic)));

View File

@ -50,7 +50,7 @@ XCAFPrs_AISObject::XCAFPrs_AISObject (const TDF_Label& theLabel)
myToSyncStyles (Standard_True) myToSyncStyles (Standard_True)
{ {
// define plastic material by default for proper color reproduction // define plastic material by default for proper color reproduction
setMaterial (myDrawer, Graphic3d_NOM_PLASTIC, Standard_False, Standard_False); setMaterial (myDrawer, Graphic3d_NameOfMaterial_Plastified, Standard_False, Standard_False);
hasOwnMaterial = Standard_True; hasOwnMaterial = Standard_True;
myLabel = theLabel; myLabel = theLabel;

View File

@ -508,7 +508,7 @@ static Standard_Integer setPrs (Draw_Interpretor& di, Standard_Integer argc, con
Handle(TPrsStd_AISPresentation) prs; Handle(TPrsStd_AISPresentation) prs;
if ( ! seq.Value(i).FindAttribute ( TPrsStd_AISPresentation::GetID(), prs ) ) { if ( ! seq.Value(i).FindAttribute ( TPrsStd_AISPresentation::GetID(), prs ) ) {
prs = TPrsStd_AISPresentation::Set(seq.Value(i),XCAFPrs_Driver::GetID()); prs = TPrsStd_AISPresentation::Set(seq.Value(i),XCAFPrs_Driver::GetID());
prs->SetMaterial ( Graphic3d_NOM_PLASTIC ); prs->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
} }
// Quantity_Color Col; // Quantity_Color Col;
// if ( colors.GetColor ( seq.Value(i), XCAFDoc_ColorSurf, Col ) ) // if ( colors.GetColor ( seq.Value(i), XCAFDoc_ColorSurf, Col ) )
@ -573,7 +573,7 @@ static Standard_Integer show (Draw_Interpretor& di, Standard_Integer argc, const
Handle(TPrsStd_AISPresentation) prs; Handle(TPrsStd_AISPresentation) prs;
if ( ! seq.Value(i).FindAttribute ( TPrsStd_AISPresentation::GetID(), prs ) ) { if ( ! seq.Value(i).FindAttribute ( TPrsStd_AISPresentation::GetID(), prs ) ) {
prs = TPrsStd_AISPresentation::Set(seq.Value(i),XCAFPrs_Driver::GetID()); prs = TPrsStd_AISPresentation::Set(seq.Value(i),XCAFPrs_Driver::GetID());
prs->SetMaterial ( Graphic3d_NOM_PLASTIC ); prs->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
} }
// Quantity_Color Col; // Quantity_Color Col;
// if ( colors.GetColor ( seq.Value(i), XCAFDoc_ColorSurf, Col ) ) // if ( colors.GetColor ( seq.Value(i), XCAFDoc_ColorSurf, Col ) )
@ -1218,7 +1218,7 @@ static Standard_Integer XSetTransparency (Draw_Interpretor& di, Standard_Integer
Handle(TPrsStd_AISPresentation) prs; Handle(TPrsStd_AISPresentation) prs;
if ( ! seq.Value(i).FindAttribute ( TPrsStd_AISPresentation::GetID(), prs ) ) { if ( ! seq.Value(i).FindAttribute ( TPrsStd_AISPresentation::GetID(), prs ) ) {
prs = TPrsStd_AISPresentation::Set(seq.Value(i),XCAFPrs_Driver::GetID()); prs = TPrsStd_AISPresentation::Set(seq.Value(i),XCAFPrs_Driver::GetID());
prs->SetMaterial ( Graphic3d_NOM_PLASTIC ); prs->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
} }
prs->SetTransparency( aTransparency ); prs->SetTransparency( aTransparency );
} }