Enumeration values have been renamed to use complete prefix Graphic3d_NOM_ -> Graphic3d_NameOfMaterial_
and to match string names (with old values preserved as aliases).
Handle(Graphic3d_AspectFillArea3d) anAspects = new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID, Quantity_NOC_RED,
Quantity_NOC_RED, Aspect_TOL_SOLID, 1.0f,
- Graphic3d_NOM_GOLD, Graphic3d_NOM_GOLD);
+ Graphic3d_NameOfMaterial_Gold, Graphic3d_NameOfMaterial_Gold);
aPrsGroup->SetGroupPrimitivesAspect (anAspects);
aPrsGroup->AddPrimitiveArray (aTriangles);
Create facet attributes.
~~~~~{.cpp}
Handle(Graphic3d_AspectFillArea3d) aFaceAspect = new Graphic3d_AspectFillArea3d();
-Graphic3d_MaterialAspect aBrassMaterial (Graphic3d_NOM_BRASS);
-Graphic3d_MaterialAspect aGoldMaterial (Graphic3d_NOM_GOLD);
+Graphic3d_MaterialAspect aBrassMaterial (Graphic3d_NameOfMaterial_Brass);
+Graphic3d_MaterialAspect aGoldMaterial (Graphic3d_NameOfMaterial_Gold);
aFaceAspect->SetInteriorStyle (Aspect_IS_SOLID_WIREFRAME);
aFaceAspect->SetInteriorColor (aMyColor);
aFaceAspect->SetDistinguishOn ();
}
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()->Display (aPrs, Standard_True);
return true;
Handle(AIS_InteractiveObject) 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);
}
Handle(AIS_Shape) aGraphicSurface =
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);
if (toDisplay)
{
// and displays it in the viewer if toDisplay = Standard_True
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);
// creates a presentation of the given shape with the given material
// (color is default for a given material)
// and displays it in the viewer if toDisplay = Standard_True
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);
// creates a presentation of the given shape with the given material
// (color is default for a given material)
{
Handle(AIS_Shape) ais = new AIS_Shape(iter.Value());
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->UpdateCurrentViewer();
#define DEFAULT_DCSMALL 0.0002
#define DEFAULT_DCVSMALL 0.00004
#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_HILIGHTCOLOR Quantity_NOC_YELLOW
// and displays it in the viewer if toDisplay = Standard_True
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);
// creates a presentation of the given shape with the given material
// (color is default for a given material)
#define DEFAULT_DCSMALL 0.0002
#define DEFAULT_DCVSMALL 0.00004
#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_HILIGHTCOLOR Quantity_NOC_YELLOW
#include "Fonc.hxx"
#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_HILIGHTCOLOR Quantity_NOC_YELLOW
myAisCylinderHead = new AIS_Shape (CylinderHead);
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);
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(myAisEngineBlock ,1,-1,Standard_False);
myAisCrankArm = new AIS_Shape (CrankArm);
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);
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);
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(myAisPropeller, 1,-1,Standard_False);
myAISContext->Display(myAISSurface, Standard_False);
myAISContext->Deactivate(myAISSurface,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->SetDeviationCoefficient (0.001);
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
#define DEFAULT_DCSMALL 0.0002
#define DEFAULT_DCVSMALL 0.00004
#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_HILIGHTCOLOR Quantity_NOC_YELLOW
// and displays it in the viewer if toDisplay = Standard_True
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);
// creates a presentation of the given shape with the given material
// (color is default for a given material)
QApplication::setOverrideCursor( Qt::WaitCursor );
TopoDS_Shape aBottle=MakeBottle(50,70,30);
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()->Display(AISBottle, Standard_False);
const Handle(AIS_InteractiveObject)& anIOAISBottle = AISBottle;
BRepTools::Read (aShape, aStream, aBuilder);
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.View()->FitAll (0.01, false);
aViewer.View()->Redraw();
myDrawer->SetLineAspect (new Prs3d_LineAspect (THE_DEFAULT_COLOR, Aspect_TOL_SOLID, 1.0));
Handle(Prs3d_ShadingAspect) aShadingAspect = new Prs3d_ShadingAspect();
- aShadingAspect->SetMaterial (Graphic3d_NOM_PLASTIC);
+ aShadingAspect->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
aShadingAspect->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
aShadingAspect->SetTransparency (THE_DEFAULT_TRANSPARENCY);
aShadingAspect->SetColor (THE_DEFAULT_COLOR);
//=======================================================================
void AIS_InteractiveContext::InitAttributes()
{
- Graphic3d_MaterialAspect aMat (Graphic3d_NOM_BRASS);
+ Graphic3d_MaterialAspect aMat (Graphic3d_NameOfMaterial_Brass);
myDefaultDrawer->ShadingAspect()->SetMaterial (aMat);
// myDefaultDrawer->ShadingAspect()->SetColor(Quantity_NOC_GRAY70);
void AIS_Plane::InitDrawerAttributes()
{
Handle(Prs3d_ShadingAspect) shasp = new Prs3d_ShadingAspect();
- shasp->SetMaterial(Graphic3d_NOM_PLASTIC);
+ shasp->SetMaterial(Graphic3d_NameOfMaterial_Plastified);
shasp->SetColor(Quantity_NOC_GRAY40);
myDrawer->SetShadingAspect(shasp);
Handle(Graphic3d_AspectFillArea3d) asf = shasp->Aspect();
AIS_InteractiveObject::UnsetColor();
{
- Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
+ Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NameOfMaterial_Brass);
Graphic3d_MaterialAspect aMat = aDefaultMat;
Quantity_Color aColor = aDefaultMat.Color();
if (myDrawer->HasLink())
}
{
- Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
+ Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NameOfMaterial_Brass);
myDrawer->ShadingAspect()->SetMaterial (myDrawer->HasLink() ?
myDrawer->Link()->ShadingAspect()->Material (myCurrentFacingModel) :
aDefaultMat,
{
myDrawer->SetLineAspect (new Prs3d_LineAspect (Quantity_NOC_WHITE, Aspect_TOL_SOLID, 1.0));
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()->SetInteriorStyle (Aspect_IS_EMPTY);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
{
myDrawer->SetLineAspect (new Prs3d_LineAspect (theLineColor, theLineType, theWidth));
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()->SetInteriorStyle (Aspect_IS_EMPTY);
myDrawer->ShadingAspect()->Aspect()->SetAlphaMode (Graphic3d_AlphaMode_Blend);
{
myDrawer->SetLineAspect (new Prs3d_LineAspect (theLineColor, theLineType, theLineWidth));
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
- myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_PLASTIC);
+ myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
myDrawer->ShadingAspect()->SetColor (theFillColor);
myDrawer->ShadingAspect()->Aspect()->SetShadingModel (Graphic3d_TOSM_UNLIT);
myDrawer->ShadingAspect()->Aspect()->SetInteriorStyle (Aspect_IS_SOLID);
|| IsTransparent()
|| myDrawer->ShadingAspect()->Aspect()->ToMapTexture())
{
- const Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NOM_BRASS);
+ const Graphic3d_MaterialAspect aDefaultMat (Graphic3d_NameOfMaterial_Brass);
Graphic3d_MaterialAspect mat = aDefaultMat;
Quantity_Color anInteriorColors[2] = {Quantity_NOC_CYAN1, Quantity_NOC_CYAN1};
if (myDrawer->HasLink())
// this should be forced back-face culling regardless Closed flag
myDrawer->TextAspect()->Aspect()->SetSuppressBackFaces (true);
- Graphic3d_MaterialAspect aMat (Graphic3d_NOM_UserDefined);
+ Graphic3d_MaterialAspect aMat (Graphic3d_NameOfMaterial_UserDefined);
aMat.SetColor (Quantity_NOC_WHITE);
aMat.SetAmbientColor (Quantity_NOC_GRAY60);
//! Sets the material for the interactive object.
virtual void UnsetMaterial() Standard_OVERRIDE
{
- Graphic3d_MaterialAspect aMat (Graphic3d_NOM_UserDefined);
+ Graphic3d_MaterialAspect aMat (Graphic3d_NameOfMaterial_UserDefined);
aMat.SetColor (Quantity_NOC_WHITE);
aMat.SetAmbientColor (Quantity_NOC_GRAY60);
myDrawer->ShadingAspect()->SetMaterial (aMat);
myToShowAxes (false)
{
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
- myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NOM_DEFAULT);
+ myDrawer->ShadingAspect()->SetMaterial (Graphic3d_NameOfMaterial_DEFAULT);
myDrawer->ShadingAspect()->SetColor (Quantity_NOC_WHITE);
if (!theTexture.IsNull())
{
static Handle(Graphic3d_AspectFillArea3d) defaultAspect()
{
- Graphic3d_MaterialAspect aMaterial (Graphic3d_NOM_DEFAULT);
+ Graphic3d_MaterialAspect aMaterial (Graphic3d_NameOfMaterial_DEFAULT);
Handle(Graphic3d_AspectFillArea3d) anAspect = new Graphic3d_AspectFillArea3d();
anAspect->SetDistinguishOff();
anAspect->SetFrontMaterial (aMaterial);
//! - Equation (0.0, 0.0, 1.0, 0)
//! - IsOn (True),
//! - IsCapping (False),
- //! - Material (Graphic3d_NOM_DEFAULT),
+ //! - Material (Graphic3d_NameOfMaterial_DEFAULT),
//! - Texture (NULL),
//! - HatchStyle (Aspect_HS_HORIZONTAL),
//! - IsHatchOn (False)
//! Name list of standard materials (defined within enumeration).
static const RawMaterial THE_MATERIALS[] =
{
- RawMaterial (Graphic3d_NOM_BRASS, "Brass"),
- RawMaterial (Graphic3d_NOM_BRONZE, "Bronze"),
- RawMaterial (Graphic3d_NOM_COPPER, "Copper"),
- RawMaterial (Graphic3d_NOM_GOLD, "Gold"),
- RawMaterial (Graphic3d_NOM_PEWTER, "Pewter"),
- RawMaterial (Graphic3d_NOM_PLASTER, "Plastered"),
- RawMaterial (Graphic3d_NOM_PLASTIC, "Plastified"),
- RawMaterial (Graphic3d_NOM_SILVER, "Silver"),
- RawMaterial (Graphic3d_NOM_STEEL, "Steel"),
- RawMaterial (Graphic3d_NOM_STONE, "Stone"),
- RawMaterial (Graphic3d_NOM_SHINY_PLASTIC, "Shiny_plastified"),
- RawMaterial (Graphic3d_NOM_SATIN, "Satined"),
- RawMaterial (Graphic3d_NOM_METALIZED, "Metalized"),
- RawMaterial (Graphic3d_NOM_NEON_GNC, "Ionized"),
- RawMaterial (Graphic3d_NOM_CHROME, "Chrome"),
- RawMaterial (Graphic3d_NOM_ALUMINIUM, "Aluminium"),
- RawMaterial (Graphic3d_NOM_OBSIDIAN, "Obsidian"),
- RawMaterial (Graphic3d_NOM_NEON_PHC, "Neon"),
- RawMaterial (Graphic3d_NOM_JADE, "Jade"),
- RawMaterial (Graphic3d_NOM_CHARCOAL, "Charcoal"),
- RawMaterial (Graphic3d_NOM_WATER, "Water"),
- RawMaterial (Graphic3d_NOM_GLASS, "Glass"),
- RawMaterial (Graphic3d_NOM_DIAMOND, "Diamond"),
- RawMaterial (Graphic3d_NOM_TRANSPARENT, "Transparent"),
- RawMaterial (Graphic3d_NOM_DEFAULT, "Default"),
- RawMaterial (Graphic3d_NOM_UserDefined, "UserDefined")
+ RawMaterial (Graphic3d_NameOfMaterial_Brass, "Brass"),
+ RawMaterial (Graphic3d_NameOfMaterial_Bronze, "Bronze"),
+ RawMaterial (Graphic3d_NameOfMaterial_Copper, "Copper"),
+ RawMaterial (Graphic3d_NameOfMaterial_Gold, "Gold"),
+ RawMaterial (Graphic3d_NameOfMaterial_Pewter, "Pewter"),
+ RawMaterial (Graphic3d_NameOfMaterial_Plastered, "Plastered"),
+ RawMaterial (Graphic3d_NameOfMaterial_Plastified, "Plastified"),
+ RawMaterial (Graphic3d_NameOfMaterial_Silver, "Silver"),
+ RawMaterial (Graphic3d_NameOfMaterial_Steel, "Steel"),
+ RawMaterial (Graphic3d_NameOfMaterial_Stone, "Stone"),
+ RawMaterial (Graphic3d_NameOfMaterial_ShinyPlastified, "Shiny_plastified"),
+ RawMaterial (Graphic3d_NameOfMaterial_Satin, "Satined"),
+ RawMaterial (Graphic3d_NameOfMaterial_Metalized, "Metalized"),
+ RawMaterial (Graphic3d_NameOfMaterial_Ionized, "Ionized"),
+ RawMaterial (Graphic3d_NameOfMaterial_Chrome, "Chrome"),
+ RawMaterial (Graphic3d_NameOfMaterial_Aluminum, "Aluminium"),
+ RawMaterial (Graphic3d_NameOfMaterial_Obsidian, "Obsidian"),
+ RawMaterial (Graphic3d_NameOfMaterial_Neon, "Neon"),
+ RawMaterial (Graphic3d_NameOfMaterial_Jade, "Jade"),
+ RawMaterial (Graphic3d_NameOfMaterial_Charcoal, "Charcoal"),
+ RawMaterial (Graphic3d_NameOfMaterial_Water, "Water"),
+ RawMaterial (Graphic3d_NameOfMaterial_Glass, "Glass"),
+ RawMaterial (Graphic3d_NameOfMaterial_Diamond, "Diamond"),
+ RawMaterial (Graphic3d_NameOfMaterial_Transparent, "Transparent"),
+ RawMaterial (Graphic3d_NameOfMaterial_DEFAULT, "Default"),
+ RawMaterial (Graphic3d_NameOfMaterial_UserDefined, "UserDefined")
};
}
{
switch (theName)
{
- case Graphic3d_NOM_PLASTIC:
+ case Graphic3d_NameOfMaterial_Plastified:
MaterialType = Graphic3d_MATERIAL_ASPECT;
Shininess = 0.0078125f;
BSDF.Normalize();
break;
- case Graphic3d_NOM_SHINY_PLASTIC:
+ case Graphic3d_NameOfMaterial_ShinyPlastified:
MaterialType = Graphic3d_MATERIAL_ASPECT;
Shininess = 1.00f;
BSDF.Ks = Graphic3d_Vec4 (0.145f, 0.145f, 0.145f, 0.17f);
BSDF.Normalize();
break;
- case Graphic3d_NOM_SATIN:
+ case Graphic3d_NameOfMaterial_Satin:
MaterialType = Graphic3d_MATERIAL_ASPECT;
Shininess = 0.09375f;
BSDF.Ks = Graphic3d_Vec4 (0.6f);
break;
- case Graphic3d_NOM_NEON_GNC:
+ case Graphic3d_NameOfMaterial_Ionized:
MaterialType = Graphic3d_MATERIAL_ASPECT;
Shininess = 0.05f;
BSDF.Le = static_cast<Graphic3d_Vec3> (Colors[Graphic3d_TOR_DIFFUSE]);
BSDF.FresnelBase = Graphic3d_Fresnel::CreateDielectric (1.5f);
break;
- case Graphic3d_NOM_METALIZED:
+ case Graphic3d_NameOfMaterial_Metalized:
MaterialType = Graphic3d_MATERIAL_ASPECT;
Shininess = 0.13f;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
Graphic3d_Fresnel::CreateSchlick (Graphic3d_Vec3 (0.2f)), 0.045f);
break;
- case Graphic3d_NOM_BRASS:
+ case Graphic3d_NameOfMaterial_Brass:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.992f, 0.941f, 0.808f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_BRONZE:
+ case Graphic3d_NameOfMaterial_Bronze:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.590f, 0.408f, 0.250f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_COPPER:
+ case Graphic3d_NameOfMaterial_Copper:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.950f, 0.640f, 0.540f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_GOLD:
+ case Graphic3d_NameOfMaterial_Gold:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (1.000f, 0.710f, 0.290f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_PEWTER:
+ case Graphic3d_NameOfMaterial_Pewter:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.333f, 0.333f, 0.522f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_PLASTER:
+ case Graphic3d_NameOfMaterial_Plastered:
MaterialType = Graphic3d_MATERIAL_ASPECT;
Shininess = 0.01f;
BSDF.Kd = Graphic3d_Vec3 (0.482353f, 0.482353f, 0.482353f);
break;
- case Graphic3d_NOM_SILVER:
+ case Graphic3d_NameOfMaterial_Silver:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.950f, 0.930f, 0.880f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_STEEL:
+ case Graphic3d_NameOfMaterial_Steel:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.560f, 0.570f, 0.580f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_STONE:
+ case Graphic3d_NameOfMaterial_Stone:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
// special case for SetColor()
BSDF.Ks = Graphic3d_Vec4 (0.00392157f, 0.00392157f, 0.00392157f, 0.5f);
break;
- case Graphic3d_NOM_CHROME:
+ case Graphic3d_NameOfMaterial_Chrome:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.975f, 0.975f, 0.975f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_ALUMINIUM:
+ case Graphic3d_NameOfMaterial_Aluminum:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
BSDF = Graphic3d_BSDF::CreateMetallic (Graphic3d_Vec3 (0.985f, 0.985f, 0.985f),
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.910f, 0.920f, 0.920f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_NEON_PHC:
+ case Graphic3d_NameOfMaterial_Neon:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
Shininess = 0.05f;
BSDF.Le = Graphic3d_Vec3 (0.0f, 1.0f, 0.46f);
BSDF.FresnelBase = Graphic3d_Fresnel::CreateDielectric (1.5f);
break;
- case Graphic3d_NOM_OBSIDIAN:
+ case Graphic3d_NameOfMaterial_Obsidian:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
Shininess = 0.3f;
BSDF.Kd = Graphic3d_Vec3 (0.023f, 0.f, 0.023f);
BSDF.Ks = Graphic3d_Vec4 (0.0156863f, 0.0156863f, 0.0156863f, 0.1f);
break;
- case Graphic3d_NOM_JADE:
+ case Graphic3d_NameOfMaterial_Jade:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
Shininess = 0.10f;
BSDF.Kd = Graphic3d_Vec3 (0.208658f, 0.415686f, 0.218401f);
BSDF.Ks = Graphic3d_Vec4 (0.611765f, 0.611765f, 0.611765f, 0.06f);
break;
- case Graphic3d_NOM_CHARCOAL:
+ case Graphic3d_NameOfMaterial_Charcoal:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
Shininess = 0.01f;
BSDF.Kd = Graphic3d_Vec3 (0.02f, 0.02f, 0.02f);
BSDF.Ks = Graphic3d_Vec4 (0.1f, 0.1f, 0.1f, 0.3f);
break;
- case Graphic3d_NOM_WATER:
+ case Graphic3d_NameOfMaterial_Water:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
RefractionIndex = 1.33f;
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.380f, 0.380f, 0.380f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_GLASS:
+ case Graphic3d_NameOfMaterial_Glass:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
RefractionIndex = 1.62f;
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.920f, 0.920f, 0.920f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_DIAMOND:
+ case Graphic3d_NameOfMaterial_Diamond:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
RefractionIndex = 2.42f;
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_TRANSPARENT:
+ case Graphic3d_NameOfMaterial_Transparent:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
RefractionIndex = 1.0f;
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.970f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_UserDefined:
+ case Graphic3d_NameOfMaterial_UserDefined:
MaterialType = Graphic3d_MATERIAL_PHYSIC;
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.1f));
Colors[Graphic3d_TOR_DIFFUSE] = Quantity_Color (Graphic3d_Vec3 (0.6f));
Colors[Graphic3d_TOR_SPECULAR] = Quantity_Color (Graphic3d_Vec3 (0.2f));
Colors[Graphic3d_TOR_EMISSION] = Quantity_Color (Graphic3d_Vec3 (0.0f));
break;
- case Graphic3d_NOM_DEFAULT:
+ case Graphic3d_NameOfMaterial_DEFAULT:
MaterialType = Graphic3d_MATERIAL_ASPECT;
Colors[Graphic3d_TOR_AMBIENT] = Quantity_Color (Graphic3d_Vec3 (0.15f));
// purpose :
// =======================================================================
Graphic3d_MaterialAspect::Graphic3d_MaterialAspect()
-: myRequestedMaterialName (Graphic3d_NOM_DEFAULT)
+: myRequestedMaterialName (Graphic3d_NameOfMaterial_DEFAULT)
{
- init (Graphic3d_NOM_DEFAULT);
+ init (Graphic3d_NameOfMaterial_DEFAULT);
}
// =======================================================================
const RawMaterial& aSrcMat = THE_MATERIALS[myRequestedMaterialName];
const Quantity_Color anAmbient((Graphic3d_Vec3 )theColor * aSrcMat.AmbientCoef);
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_DIFFUSE].IsEqual (aDiffuse)))
{
void Graphic3d_MaterialAspect::SetAmbientColor (const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
- && myMaterialName != Graphic3d_NOM_UserDefined
+ && myMaterialName != Graphic3d_NameOfMaterial_UserDefined
&& !myColors[Graphic3d_TOR_AMBIENT].IsEqual (theColor))
{
setUserMaterial();
void Graphic3d_MaterialAspect::SetDiffuseColor (const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
- && myMaterialName != Graphic3d_NOM_UserDefined
+ && myMaterialName != Graphic3d_NameOfMaterial_UserDefined
&& !myColors[Graphic3d_TOR_DIFFUSE].IsEqual (theColor))
{
setUserMaterial();
void Graphic3d_MaterialAspect::SetSpecularColor (const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
- && myMaterialName != Graphic3d_NOM_UserDefined
+ && myMaterialName != Graphic3d_NameOfMaterial_UserDefined
&& !myColors[Graphic3d_TOR_SPECULAR].IsEqual (theColor))
{
setUserMaterial();
void Graphic3d_MaterialAspect::SetEmissiveColor (const Quantity_Color& theColor)
{
if (myMaterialType == Graphic3d_MATERIAL_PHYSIC
- && myMaterialName != Graphic3d_NOM_UserDefined
+ && myMaterialName != Graphic3d_NameOfMaterial_UserDefined
&& !myColors[Graphic3d_TOR_EMISSION].IsEqual (theColor))
{
setUserMaterial();
// parse aliases
if (aName == "Plastic") // Plastified
{
- theMat = Graphic3d_NOM_PLASTIC;
+ theMat = Graphic3d_NameOfMaterial_Plastified;
return Standard_True;
}
else if (aName == "Shiny_plastic") // Shiny_plastified
{
- theMat = Graphic3d_NOM_SHINY_PLASTIC;
+ theMat = Graphic3d_NameOfMaterial_ShinyPlastified;
return Standard_True;
}
else if (aName == "Plaster") // Plastered
{
- theMat = Graphic3d_NOM_PLASTER;
+ theMat = Graphic3d_NameOfMaterial_Plastered;
return Standard_True;
}
else if (aName == "Satin") // Satined
{
- theMat = Graphic3d_NOM_SATIN;
+ theMat = Graphic3d_NameOfMaterial_Satin;
return Standard_True;
}
else if (aName == "Neon_gnc") // Ionized
{
- theMat = Graphic3d_NOM_NEON_GNC;
+ theMat = Graphic3d_NameOfMaterial_Ionized;
return Standard_True;
}
else if (aName == "Neon_phc") // Neon
{
- theMat = Graphic3d_NOM_NEON_PHC;
+ theMat = Graphic3d_NameOfMaterial_Neon;
return Standard_True;
}
return Standard_False;
DEFINE_STANDARD_ALLOC
//! 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()].
Standard_EXPORT static Standard_CString MaterialName (const Standard_Integer theRank);
Standard_EXPORT static Standard_Boolean MaterialFromName (const Standard_CString theName,
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)
{
- Graphic3d_NameOfMaterial aMat = Graphic3d_NOM_DEFAULT;
+ Graphic3d_NameOfMaterial aMat = Graphic3d_NameOfMaterial_DEFAULT;
MaterialFromName (theName, aMat);
return aMat;
}
{
// if a component of a "standard" material change, the
// result is no more standard (a blue gold is not a gold)
- myMaterialName = Graphic3d_NOM_UserDefined;
+ myMaterialName = Graphic3d_NameOfMaterial_UserDefined;
myStringName = theName;
}
{
// if a component of a "standard" material change, the
// 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";
}
}
#ifndef _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
{
-Graphic3d_NOM_BRASS,
-Graphic3d_NOM_BRONZE,
-Graphic3d_NOM_COPPER,
-Graphic3d_NOM_GOLD,
-Graphic3d_NOM_PEWTER,
-Graphic3d_NOM_PLASTER,
-Graphic3d_NOM_PLASTIC,
-Graphic3d_NOM_SILVER,
-Graphic3d_NOM_STEEL,
-Graphic3d_NOM_STONE,
-Graphic3d_NOM_SHINY_PLASTIC,
-Graphic3d_NOM_SATIN,
-Graphic3d_NOM_METALIZED,
-Graphic3d_NOM_NEON_GNC,
-Graphic3d_NOM_CHROME,
-Graphic3d_NOM_ALUMINIUM,
-Graphic3d_NOM_OBSIDIAN,
-Graphic3d_NOM_NEON_PHC,
-Graphic3d_NOM_JADE,
-Graphic3d_NOM_CHARCOAL,
-Graphic3d_NOM_WATER,
-Graphic3d_NOM_GLASS,
-Graphic3d_NOM_DIAMOND,
-Graphic3d_NOM_TRANSPARENT,
-Graphic3d_NOM_DEFAULT,
-Graphic3d_NOM_UserDefined
+ Graphic3d_NameOfMaterial_Brass, //!< Brass (Physic)
+ Graphic3d_NameOfMaterial_Bronze, //!< Bronze (Physic)
+ Graphic3d_NameOfMaterial_Copper, //!< Copper (Physic)
+ Graphic3d_NameOfMaterial_Gold, //!< Gold (Physic)
+ Graphic3d_NameOfMaterial_Pewter, //!< Pewter (Physic)
+ Graphic3d_NameOfMaterial_Plastered, //!< Plastered (Generic)
+ Graphic3d_NameOfMaterial_Plastified, //!< Plastified (Generic)
+ Graphic3d_NameOfMaterial_Silver, //!< Silver (Physic)
+ Graphic3d_NameOfMaterial_Steel, //!< Steel (Physic)
+ Graphic3d_NameOfMaterial_Stone, //!< Stone (Physic)
+ Graphic3d_NameOfMaterial_ShinyPlastified, //!< Shiny Plastified (Generic)
+ Graphic3d_NameOfMaterial_Satin, //!< Satin (Generic)
+ Graphic3d_NameOfMaterial_Metalized, //!< Metalized (Generic)
+ Graphic3d_NameOfMaterial_Ionized, //!< Ionized (Generic)
+ Graphic3d_NameOfMaterial_Chrome, //!< Chrome (Physic)
+ Graphic3d_NameOfMaterial_Aluminum, //!< Aluminum (Physic)
+ Graphic3d_NameOfMaterial_Obsidian, //!< Obsidian (Physic)
+ Graphic3d_NameOfMaterial_Neon, //!< Neon (Physic)
+ Graphic3d_NameOfMaterial_Jade, //!< Jade (Physic)
+ Graphic3d_NameOfMaterial_Charcoal, //!< Charcoal (Physic)
+ Graphic3d_NameOfMaterial_Water, //!< Water (Physic)
+ Graphic3d_NameOfMaterial_Glass, //!< Glass (Physic)
+ Graphic3d_NameOfMaterial_Diamond, //!< Diamond (Physic)
+ Graphic3d_NameOfMaterial_Transparent, //!< Transparent (Physic)
+ Graphic3d_NameOfMaterial_DEFAULT, //!< Default (Generic);
+ //! 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
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++)
{
// OCC20644 "plastic" is most suitable here, as it is "non-physic"
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++)
{
// OCC20644 "plastic" is most suitable here, as it is "non-physic"
SetHilightMode( MeshVS_DMF_WireFrame ); // Wireframe as default hilight mode
SetColor ( Quantity_NOC_WHITE );
- SetMaterial ( Graphic3d_NOM_PLASTIC );
+ SetMaterial (Graphic3d_NameOfMaterial_Plastified);
myCurrentDrawer = new MeshVS_Drawer();
myCurrentDrawer->SetColor ( MeshVS_DA_InteriorColor, Quantity_NOC_BLUE4 );
myHilightDrawer->SetColor ( MeshVS_DA_EdgeColor, Quantity_NOC_GREEN );
myHilightDrawer->SetInteger ( MeshVS_DA_EdgeType, Aspect_TOL_SOLID );
myHilightDrawer->SetDouble ( MeshVS_DA_EdgeWidth, 1.0 );
- myHilightDrawer->SetMaterial ( MeshVS_DA_FrontMaterial, Graphic3d_NOM_PLASTIC );
- myHilightDrawer->SetMaterial ( MeshVS_DA_BackMaterial, Graphic3d_NOM_PLASTIC );
+ myHilightDrawer->SetMaterial ( MeshVS_DA_FrontMaterial, Graphic3d_NameOfMaterial_Plastified );
+ myHilightDrawer->SetMaterial ( MeshVS_DA_BackMaterial, Graphic3d_NameOfMaterial_Plastified );
myHilightDrawer->SetColor ( MeshVS_DA_BeamColor, Quantity_NOC_GRAY80 );
myHilightDrawer->SetInteger ( MeshVS_DA_BeamType, Aspect_TOL_SOLID );
// Draw faces with nodal color
// 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)
{
aMaterial[i].SetSpecularColor (Quantity_NOC_BLACK);
( const Handle(MeshVS_Drawer)& theDr,
const Standard_Boolean UseDefaults )
{
- Graphic3d_MaterialAspect aFrMat = Graphic3d_NOM_BRASS;
- Graphic3d_MaterialAspect aBackMat = Graphic3d_NOM_BRASS;
- Standard_Integer aFrMatI = (Standard_Integer)Graphic3d_NOM_BRASS;
- Standard_Integer aBackMatI = (Standard_Integer)Graphic3d_NOM_BRASS;
+ Graphic3d_MaterialAspect aFrMat = Graphic3d_NameOfMaterial_Brass;
+ Graphic3d_MaterialAspect aBackMat = Graphic3d_NameOfMaterial_Brass;
+ Standard_Integer aFrMatI = (Standard_Integer)Graphic3d_NameOfMaterial_Brass;
+ Standard_Integer aBackMatI = (Standard_Integer)Graphic3d_NameOfMaterial_Brass;
if ( !theDr->GetInteger ( MeshVS_DA_FrontMaterial, aFrMatI ) && !UseDefaults )
return 0;
//! Returns settings for shading aspects.
//! These settings can be edited. The default values are:
//! - Color: Quantity_NOC_YELLOW
- //! - Material: Graphic3d_NOM_BRASS
+ //! - Material: Graphic3d_NameOfMaterial_Brass
//! Shading aspect is obtained through decomposition of
//! 3d faces into triangles, each side of each triangle
//! being a chord of the corresponding curved edge in the face.
//=======================================================================
Prs3d_ShadingAspect::Prs3d_ShadingAspect()
{
- const Graphic3d_MaterialAspect aMat (Graphic3d_NOM_BRASS);
+ const Graphic3d_MaterialAspect aMat (Graphic3d_NameOfMaterial_Brass);
const Quantity_Color aColor = aMat.AmbientColor();
myAspect = new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID,
aColor,
myDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
}
- Graphic3d_MaterialAspect aShadeMat (Graphic3d_NOM_DEFAULT);
+ Graphic3d_MaterialAspect aShadeMat (Graphic3d_NameOfMaterial_DEFAULT);
aShadeMat.SetAmbientColor (Quantity_NOC_BLACK);
aShadeMat.SetDiffuseColor (Quantity_NOC_BLACK);
aShadeMat.SetSpecularColor(Quantity_NOC_BLACK);
TopoDS_Shape shape1 = BRepPrimAPI_MakeBox(50,50,50).Shape();
Handle(AIS_Shape) AS = new AIS_Shape(shape1);
AS->SetDisplayMode(1);
- Graphic3d_MaterialAspect mat(Graphic3d_NOM_PLASTIC);
+ Graphic3d_MaterialAspect mat (Graphic3d_NameOfMaterial_Plastified);
AS->SetMaterial(mat);
AS->SetColor(Quantity_NOC_RED);
myAISContext->Display (AS, Standard_False);
Handle(AIS_Shape) ais = new AIS_Shape(sh);
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 colb(0.0, 0.0, 0.6, Quantity_TOC_sRGB);
TopoDS_Face F1= bzf1.Face();
ais1 = new AIS_Shape(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);
BRep_Builder B;
TopoDS_Shell shell;
mkw.Add(*E6);
FP = BRepBuilderAPI_MakeFace(mkw.Wire());
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);
DBRep::Set("FP",FP);
fillet.Build();
FP1 = fillet.Shape();
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);
DBRep::Set("FP1",FP1);
myGraphicStructure = new Graphic3d_Structure (aViewer->StructureManager());
Handle(Graphic3d_Group) aGroup = myGraphicStructure->NewGroup();
Handle(Graphic3d_AspectFillArea3d) anAsp = new Graphic3d_AspectFillArea3d();
- Graphic3d_MaterialAspect aPlastic (Graphic3d_NOM_PLASTIC);
+ Graphic3d_MaterialAspect aPlastic (Graphic3d_NameOfMaterial_Plastified);
aPlastic.SetColor (theColor);
aPlastic.SetTransparency (0.5);
anAsp->SetFrontMaterial (aPlastic);
#define DEFAULT_COLOR Quantity_NOC_GOLDENROD
#define DEFAULT_FREEBOUNDARY_COLOR Quantity_NOC_GREEN
-#define DEFAULT_MATERIAL Graphic3d_NOM_BRASS
+#define DEFAULT_MATERIAL Graphic3d_NameOfMaterial_Brass
//=======================================================================
// function : GetColorFromName
AlphaMode (Graphic3d_AlphaMode_BlendAuto),
AlphaCutoff (0.5f),
ToSetMaterial (0),
- Material (Graphic3d_NOM_DEFAULT),
+ Material (Graphic3d_NameOfMaterial_DEFAULT),
ToSetShowFreeBoundary (0),
ToSetFreeBoundaryWidth (0),
FreeBoundaryWidth (1.0),
|| anArg == "-unsetmaterial")
{
aChangeSet->ToSetMaterial = -1;
- aChangeSet->Material = Graphic3d_NOM_DEFAULT;
+ aChangeSet->Material = Graphic3d_NameOfMaterial_DEFAULT;
}
else if (anArg == "-subshape"
|| anArg == "-subshapes")
//aChangeSet->ToSetBackFaceColor = -1; // should be reset by ToSetColor
//aChangeSet->BackFaceColor = DEFAULT_COLOR;
aChangeSet->ToSetMaterial = -1;
- aChangeSet->Material = Graphic3d_NOM_DEFAULT;
+ aChangeSet->Material = Graphic3d_NameOfMaterial_DEFAULT;
aChangeSet->ToSetShowFreeBoundary = -1;
aChangeSet->ToSetFreeBoundaryColor = -1;
aChangeSet->FreeBoundaryColor = DEFAULT_FREEBOUNDARY_COLOR;
}
// 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.SetSpecularColor(Quantity_Color (Graphic3d_Vec3 (0.50f)));
Handle(Graphic3d_AspectFillArea3d) anAspect
TCollection_AsciiString anArg (theArgVec[anArgIter]);
anArg.LowerCase();
Graphic3d_NameOfMaterial aMat = Graphic3d_MaterialAspect::MaterialFromName (theArgVec[anArgIter]);
- if (aMat != Graphic3d_NOM_DEFAULT)
+ if (aMat != Graphic3d_NameOfMaterial_DEFAULT)
{
aMatList.Append (aMat);
}
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);
}
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);
}
const Handle(Prs3d_Drawer)& aStyle = aCtx->HighlightStyle (aType);
Graphic3d_NameOfMaterial aMatName = Graphic3d_MaterialAspect::MaterialFromName (theArgVec[anArgIter + 1]);
- if (aMatName != Graphic3d_NOM_DEFAULT)
+ if (aMatName != Graphic3d_NameOfMaterial_DEFAULT)
{
++anArgIter;
Handle(Graphic3d_AspectFillArea3d) anAspect = new Graphic3d_AspectFillArea3d();
{
if (myCommonMat.IsDefined)
{
- theAspect = Graphic3d_MaterialAspect (Graphic3d_NOM_UserDefined);
+ theAspect = Graphic3d_MaterialAspect (Graphic3d_NameOfMaterial_UserDefined);
theAspect.SetAmbientColor (myCommonMat.AmbientColor);
theAspect.SetDiffuseColor (myCommonMat.DiffuseColor);
theAspect.SetSpecularColor(myCommonMat.SpecularColor);
if (!myCommonMat.IsDefined)
{
// convert metal-roughness into common
- theAspect = Graphic3d_MaterialAspect (Graphic3d_NOM_UserDefined);
+ theAspect = Graphic3d_MaterialAspect (Graphic3d_NameOfMaterial_UserDefined);
theAspect.SetDiffuseColor (myPbrMat.BaseColor.GetRGB());
theAspect.SetAlpha (myPbrMat.BaseColor.Alpha());
theAspect.SetSpecularColor(Quantity_Color (Graphic3d_Vec3 (myPbrMat.Metallic)));
myToSyncStyles (Standard_True)
{
// 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;
myLabel = theLabel;
Handle(TPrsStd_AISPresentation) prs;
if ( ! seq.Value(i).FindAttribute ( TPrsStd_AISPresentation::GetID(), prs ) ) {
prs = TPrsStd_AISPresentation::Set(seq.Value(i),XCAFPrs_Driver::GetID());
- prs->SetMaterial ( Graphic3d_NOM_PLASTIC );
+ prs->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
}
// Quantity_Color Col;
// if ( colors.GetColor ( seq.Value(i), XCAFDoc_ColorSurf, Col ) )
Handle(TPrsStd_AISPresentation) prs;
if ( ! seq.Value(i).FindAttribute ( TPrsStd_AISPresentation::GetID(), prs ) ) {
prs = TPrsStd_AISPresentation::Set(seq.Value(i),XCAFPrs_Driver::GetID());
- prs->SetMaterial ( Graphic3d_NOM_PLASTIC );
+ prs->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
}
// Quantity_Color Col;
// if ( colors.GetColor ( seq.Value(i), XCAFDoc_ColorSurf, Col ) )
Handle(TPrsStd_AISPresentation) prs;
if ( ! seq.Value(i).FindAttribute ( TPrsStd_AISPresentation::GetID(), prs ) ) {
prs = TPrsStd_AISPresentation::Set(seq.Value(i),XCAFPrs_Driver::GetID());
- prs->SetMaterial ( Graphic3d_NOM_PLASTIC );
+ prs->SetMaterial (Graphic3d_NameOfMaterial_Plastified);
}
prs->SetTransparency( aTransparency );
}