#include <Graphic3d_ArrayOfQuadrangles.hxx>
#include <Graphic3d_ArrayOfQuadrangleStrips.hxx>
#include <Graphic3d_ArrayOfPolygons.hxx>
+#include <Graphic3d_AttribBuffer.hxx>
#include <Graphic3d_AspectMarker3d.hxx>
#include <Graphic3d_Group.hxx>
#include <Standard_Real.hxx>
extern Standard_Boolean VDisplayAISObject (const TCollection_AsciiString& theName,
const Handle(AIS_InteractiveObject)& theAISObj,
Standard_Boolean theReplaceIfExists = Standard_True);
-extern int ViewerMainLoop(Standard_Integer argc, const char** argv);
extern Handle(AIS_InteractiveContext)& TheAISContext();
namespace
return Standard_False;
}
- aComponent->SetXDirection(aXDir);
- aComponent->SetDirection (aZDir);
+ aComponent->SetAx2 (gp_Ax2 (aComponent->Location(), aZDir, aXDir));
}
if (aMapOfArgs.Find ("dispmode", aValues))
theTrihedron->SetSelectionPriority (aDatumPart, aValues->Value (2).IntegerValue());
}
- if (aMapOfArgs.Find ("labels", aValues))
+ if (aMapOfArgs.Find ("labels", aValues)
+ || aMapOfArgs.Find ("label", aValues))
{
Prs3d_DatumParts aDatumPart = Prs3d_DP_None;
- if (aValues->Size() > 2
+ if (aValues->Size() >= 2
&& convertToDatumPart(aValues->Value(1), aDatumPart)
&& aDatumPart >= Prs3d_DP_XAxis
&& aDatumPart <= Prs3d_DP_ZAxis) // labels are set to axes only
}
return Standard_True;
}
+
+ //! Auxiliary function to parse font aspect style argument
+ static Standard_Boolean parseFontStyle (const TCollection_AsciiString& theArg,
+ Font_FontAspect& theAspect)
+ {
+ if (theArg == "regular"
+ || *theArg.ToCString() == 'r')
+ {
+ theAspect = Font_FA_Regular;
+ return Standard_True;
+ }
+ else if (theArg == "bolditalic"
+ || theArg == "bold-italic"
+ || theArg == "italic-bold"
+ || theArg == "italicbold")
+ {
+ theAspect = Font_FA_BoldItalic;
+ return Standard_True;
+ }
+ else if (theArg == "bold"
+ || *theArg.ToCString() == 'b')
+ {
+ theAspect = Font_FA_Bold;
+ return Standard_True;
+ }
+ else if (theArg == "italic"
+ || *theArg.ToCString() == 'i')
+ {
+ theAspect = Font_FA_Italic;
+ return Standard_True;
+ }
+ return Standard_False;
+ }
+
+ //! Auxiliary function to parse font strict level argument
+ static Standard_Integer parseFontStrictLevel (const Standard_Integer theArgNb,
+ const char** theArgVec,
+ Font_StrictLevel& theLevel)
+ {
+ if (theArgNb >= 1)
+ {
+ TCollection_AsciiString anArg (theArgVec[0]);
+ anArg.LowerCase();
+ if (anArg == "any")
+ {
+ theLevel = Font_StrictLevel_Any;
+ return 1;
+ }
+ else if (anArg == "aliases")
+ {
+ theLevel = Font_StrictLevel_Aliases;
+ return 1;
+ }
+ else if (anArg == "strict")
+ {
+ theLevel = Font_StrictLevel_Strict;
+ return 1;
+ }
+ }
+ theLevel = Font_StrictLevel_Strict;
+ return 0;
+ }
}
//==============================================================================
{
theGeomCircle = Cir.Value();
}
- catch (StdFail_NotDone)
+ catch (StdFail_NotDone const&)
{
std::cout << "vcircle error: can't create circle\n";
return -1; // TCL_ERROR
{
theGeomCircle = Cir.Value();
}
- catch (StdFail_NotDone)
+ catch (StdFail_NotDone const&)
{
std::cout << "vcircle error: can't create circle\n";
return -1; // TCL_ERROR
// Get isFilled
Standard_Boolean isFilled;
std::cout << "Enter filled status (0 or 1)\n";
- cin >> isFilled;
+ std::cin >> isFilled;
// Construction of the circle
gp_Pnt A = BRep_Tool::Pnt (TopoDS::Vertex (aShapeA));
{
theGeomCircle = Cir.Value();
}
- catch (StdFail_NotDone)
+ catch (StdFail_NotDone const&)
{
std::cout << "vcircle error: can't create circle\n";
return -1; // TCL_ERROR
do
{
std::cout << " Enter the value of the radius:\n";
- cin >> theRad;
+ std::cin >> theRad;
} while (theRad <= 0);
// Get filled status
Standard_Boolean isFilled;
std::cout << "Enter filled status (0 or 1)\n";
- cin >> isFilled;
+ std::cin >> isFilled;
// Recover the normal to the plane. tag
TopoDS_Face myFace = TopoDS::Face(aShapeA);
{
theGeomCircle = Cir.Value();
}
- catch (StdFail_NotDone)
+ catch (StdFail_NotDone const&)
{
std::cout << "vcircle error: can't create circle\n";
return -1; // TCL_ERROR
}
else if (aParam == "-color")
{
- if (anArgIt + 1 >= theArgsNb)
- {
- std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n";
- return 1;
- }
-
- TCollection_AsciiString aColor (theArgVec[anArgIt + 1]);
- Quantity_NameOfColor aNameOfColor = Quantity_NOC_BLACK;
- if (Quantity_Color::ColorFromName (aColor.ToCString(), aNameOfColor))
- {
- anArgIt += 1;
- aTextPrs->SetColor (aNameOfColor);
- continue;
- }
- else if (anArgIt + 3 >= theArgsNb)
- {
- std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n";
- return 1;
- }
-
- TCollection_AsciiString aGreen (theArgVec[anArgIt + 2]);
- TCollection_AsciiString aBlue (theArgVec[anArgIt + 3]);
- if (!aColor.IsRealValue()
- || !aGreen.IsRealValue()
- || !aBlue.IsRealValue())
+ Quantity_Color aColor;
+ Standard_Integer aNbParsed = ViewerTest::ParseColor (theArgsNb - anArgIt - 1,
+ theArgVec + anArgIt + 1,
+ aColor);
+ if (aNbParsed == 0)
{
- std::cout << "Error: wrong syntax at '" << aParam.ToCString() << "'.\n";
+ std::cout << "Syntax error at '" << aParam << "'\n";
return 1;
}
-
- const Graphic3d_Vec3d anRGB (aColor.RealValue(),
- aGreen.RealValue(),
- aBlue.RealValue());
-
- aTextPrs->SetColor (Quantity_Color (anRGB.r(), anRGB.g(), anRGB.b(), Quantity_TOC_RGB));
- anArgIt += 3;
+ anArgIt += aNbParsed;
+ aTextPrs->SetColor (aColor);
}
else if (aParam == "-halign")
{
TCollection_AsciiString anOption (theArgVec[anArgIt]);
anOption.LowerCase();
- if (anOption.IsEqual ("regular"))
- {
- aTextPrs->SetFontAspect (Font_FA_Regular);
- }
- else if (anOption.IsEqual ("bold"))
- {
- aTextPrs->SetFontAspect (Font_FA_Bold);
- }
- else if (anOption.IsEqual ("italic"))
+ Font_FontAspect aFontAspect = Font_FA_Undefined;
+ if (!parseFontStyle (anOption, aFontAspect))
{
- aTextPrs->SetFontAspect (Font_FA_Italic);
- }
- else if (anOption.IsEqual ("bolditalic"))
- {
- aTextPrs->SetFontAspect (Font_FA_BoldItalic);
+ std::cout << "Error: unknown font aspect '" << anOption << "'.\n";
+ return 1;
}
+ aTextPrs->SetFontAspect (aFontAspect);
}
else if (aParam == "-font")
{
else if (aParam == "-subcolor"
|| aParam == "-subtitlecolor")
{
- if (anArgIt + 1 >= theArgsNb)
- {
- std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n";
- return 1;
- }
-
- TCollection_AsciiString aColor (theArgVec[anArgIt + 1]);
- Quantity_NameOfColor aNameOfColor = Quantity_NOC_BLACK;
- if (Quantity_Color::ColorFromName (aColor.ToCString(), aNameOfColor))
- {
- anArgIt += 1;
- aTextPrs->SetColorSubTitle (aNameOfColor);
- continue;
- }
- else if (anArgIt + 3 >= theArgsNb)
- {
- std::cout << "Error: wrong number of values for parameter '" << aParam.ToCString() << "'.\n";
- return 1;
- }
-
- TCollection_AsciiString aGreen (theArgVec[anArgIt + 2]);
- TCollection_AsciiString aBlue (theArgVec[anArgIt + 3]);
- if (!aColor.IsRealValue()
- || !aGreen.IsRealValue()
- || !aBlue.IsRealValue())
+ Quantity_Color aColor;
+ Standard_Integer aNbParsed = ViewerTest::ParseColor (theArgsNb - anArgIt - 1,
+ theArgVec + anArgIt + 1,
+ aColor);
+ if (aNbParsed == 0)
{
- std::cout << "Error: wrong syntax at '" << aParam.ToCString() << "'.\n";
+ std::cout << "Syntax error at '" << aParam << "'\n";
return 1;
}
-
- const Graphic3d_Vec3d anRGB (aColor.RealValue(),
- aGreen.RealValue(),
- aBlue.RealValue());
-
- aTextPrs->SetColorSubTitle (Quantity_Color (anRGB.r(), anRGB.g(), anRGB.b(), Quantity_TOC_RGB));
- anArgIt += 3;
+ anArgIt += aNbParsed;
+ aTextPrs->SetColorSubTitle (aColor);
}
else if (aParam == "-2d")
{
// Setting material properties, very important for desirable visual result!
Graphic3d_MaterialAspect aMat (Graphic3d_NOM_PLASTIC);
- aMat.SetAmbient (0.2f);
- aMat.SetSpecular (0.5f);
+ aMat.SetAmbientColor (Quantity_Color (Graphic3d_Vec3 (0.04f)));
+ aMat.SetSpecularColor(Quantity_Color (Graphic3d_Vec3 (0.50f)));
Handle(Graphic3d_AspectFillArea3d) anAspect
= new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID,
Quantity_NOC_RED,
aMat,
aMat);
Handle(Prs3d_ShadingAspect) aShAsp = new Prs3d_ShadingAspect();
- if (toShowEdges)
- {
- anAspect->SetEdgeOn();
- }
- else
- {
- anAspect->SetEdgeOff();
- }
+ anAspect->SetDrawEdges (toShowEdges);
aShAsp->SetAspect (anAspect);
aShape->Attributes()->SetShadingAspect (aShAsp);
gp_Ax2 aProjAx;
bool hasViewDirArg = false;
Prs3d_TypeOfHLR anAlgoType = Prs3d_TOH_PolyAlgo;
- bool toShowTangentEdges = false, toShowHiddenEdges = false;
+ bool toShowCNEdges = false, toShowHiddenEdges = false;
int aNbIsolines = 0;
if (Handle(V3d_Viewer) aViewer = ViewerTest::GetViewerFromContext())
{
|| anArgCase == "-tangentedges"
|| anArgCase == "-tangent")
{
- toShowTangentEdges = true;
+ toShowCNEdges = true;
if (anArgIter + 1 < theArgNb
- && ViewerTest::ParseOnOff (theArgVec[anArgIter + 1], toShowTangentEdges))
+ && ViewerTest::ParseOnOff (theArgVec[anArgIter + 1], toShowCNEdges))
{
++anArgIter;
}
aVisible[HLRBRep_Sharp] = aHLRToShape.VCompound();
aVisible[HLRBRep_OutLine] = aHLRToShape.OutLineVCompound(); // extract visible outlines
- aVisible[HLRBRep_RgNLine] = aHLRToShape.RgNLineVCompound();
- if (toShowTangentEdges)
+ aVisible[HLRBRep_Rg1Line] = aHLRToShape.Rg1LineVCompound();
+ if (toShowCNEdges)
{
- aVisible[HLRBRep_Rg1Line] = aHLRToShape.Rg1LineVCompound();
+ aVisible[HLRBRep_RgNLine] = aHLRToShape.RgNLineVCompound();
}
if (toShowHiddenEdges)
{
aHidden[HLRBRep_Sharp] = aHLRToShape.HCompound();
aHidden[HLRBRep_OutLine] = aHLRToShape.OutLineHCompound();
- aHidden[HLRBRep_RgNLine] = aHLRToShape.RgNLineHCompound();
- if (toShowTangentEdges)
+ aHidden[HLRBRep_Rg1Line] = aHLRToShape.Rg1LineHCompound();
+ if (toShowCNEdges)
{
- aHidden[HLRBRep_Rg1Line] = aHLRToShape.Rg1LineHCompound();
+ aHidden[HLRBRep_RgNLine] = aHLRToShape.RgNLineHCompound();
}
}
}
HLRBRep_HLRToShape aHLRToShape (aHlrAlgo);
aVisible[HLRBRep_Sharp] = aHLRToShape.VCompound();
aVisible[HLRBRep_OutLine] = aHLRToShape.OutLineVCompound();
- aVisible[HLRBRep_RgNLine] = aHLRToShape.RgNLineVCompound();
- if (toShowTangentEdges)
+ aVisible[HLRBRep_Rg1Line] = aHLRToShape.Rg1LineVCompound();
+ if (toShowCNEdges)
{
- aVisible[HLRBRep_Rg1Line] = aHLRToShape.Rg1LineVCompound();
+ aVisible[HLRBRep_RgNLine] = aHLRToShape.RgNLineVCompound();
}
aVisible[HLRBRep_IsoLine] = aHLRToShape.IsoLineVCompound();
{
aHidden[HLRBRep_Sharp] = aHLRToShape.HCompound();
aHidden[HLRBRep_OutLine] = aHLRToShape.OutLineHCompound();
- aHidden[HLRBRep_RgNLine] = aHLRToShape.RgNLineHCompound();
- if (toShowTangentEdges)
+ aHidden[HLRBRep_Rg1Line] = aHLRToShape.Rg1LineHCompound();
+ if (toShowCNEdges)
{
- aHidden[HLRBRep_Rg1Line] = aHLRToShape.Rg1LineHCompound();
+ aHidden[HLRBRep_RgNLine] = aHLRToShape.RgNLineHCompound();
}
aHidden[HLRBRep_IsoLine] = aHLRToShape.IsoLineHCompound();
}
MyPArrayObject (const Handle(Graphic3d_ArrayOfPrimitives)& thePArray) : myPArray (thePArray) {}
- MyPArrayObject (Handle(TColStd_HArray1OfAsciiString) theArrayDescription,
- Handle(Graphic3d_AspectMarker3d) theMarkerAspect = NULL);
+ MyPArrayObject (Graphic3d_TypeOfPrimitiveArray thePrimType,
+ const Handle(TColStd_HArray1OfAsciiString)& theDesc,
+ const Handle(Graphic3d_AspectMarker3d)& theMarkerAspect)
+ {
+ Init (thePrimType, theDesc, theMarkerAspect, Standard_False);
+ }
+
+ //! Initialize the array from specified description.
+ Standard_Boolean Init (Graphic3d_TypeOfPrimitiveArray thePrimType,
+ const Handle(TColStd_HArray1OfAsciiString)& theDesc,
+ const Handle(Graphic3d_AspectMarker3d)& theMarkerAspect,
+ Standard_Boolean theToPatch);
DEFINE_STANDARD_RTTI_INLINE(MyPArrayObject,AIS_InteractiveObject);
virtual Standard_Boolean AcceptDisplayMode (const Standard_Integer theMode) const Standard_OVERRIDE { return theMode == 0; }
+ //! Sets color to this interactive object
+ //! @param theColor the color to be set
+ virtual void SetColor (const Quantity_Color& theColor) Standard_OVERRIDE;
+
private:
void Compute (const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
const Standard_Integer /*theMode*/) Standard_OVERRIDE;
bool CheckInputCommand (const TCollection_AsciiString theCommand,
- const Handle(TColStd_HArray1OfAsciiString) theArgsArray,
+ const Handle(TColStd_HArray1OfAsciiString)& theArgsArray,
Standard_Integer &theArgIndex,
Standard_Integer theArgCount,
Standard_Integer theMaxArgs);
+ //! Sets color for the shading aspect of the drawer used in this interactive object
+ //! @param theColor the color to be set
+ void setColorForShadingAspect(const Quantity_Color& theColor);
+
+ //! Replaces shading aspect from myDrawer->Link() with the own shading aspect of myDrawer for this interactive object
+ void replaceShadingAspect();
+
protected:
- Handle(TColStd_HArray1OfAsciiString) myArrayDescription;
Handle(Graphic3d_AspectMarker3d) myMarkerAspect;
Handle(Graphic3d_ArrayOfPrimitives) myPArray;
{
aGroup->SetGroupPrimitivesAspect (myMarkerAspect);
}
- aGroup->SetGroupPrimitivesAspect (myDrawer->LineAspect()->Aspect());
- aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
+ else
+ {
+ aGroup->SetGroupPrimitivesAspect (myDrawer->ShadingAspect()->Aspect());
+ }
aGroup->AddPrimitiveArray (myPArray);
}
-MyPArrayObject::MyPArrayObject (Handle(TColStd_HArray1OfAsciiString) theArrayDescription,
- Handle(Graphic3d_AspectMarker3d) theMarkerAspect)
+Standard_Boolean MyPArrayObject::Init (Graphic3d_TypeOfPrimitiveArray thePrimType,
+ const Handle(TColStd_HArray1OfAsciiString)& theDesc,
+ const Handle(Graphic3d_AspectMarker3d)& theMarkerAspect,
+ Standard_Boolean theToPatch)
{
- myArrayDescription = theArrayDescription;
myMarkerAspect = theMarkerAspect;
+ if (!theToPatch)
+ {
+ myPArray.Nullify();
+ }
// Parsing array description
Standard_Integer aVertexNum = 0, aBoundNum = 0, aEdgeNum = 0;
- Standard_Boolean hasVColors, hasBColors, hasNormals, hasTexels;
- hasVColors = hasNormals = hasBColors = hasTexels = Standard_False;
-
- Standard_Integer anArgIndex = 0;
- Standard_Integer anArgsCount = myArrayDescription->Length();
- TCollection_AsciiString anArrayType = myArrayDescription->Value (anArgIndex++);
+ Graphic3d_ArrayFlags anArrayFlags = Graphic3d_ArrayFlags_None;
+ const Standard_Integer anArgsCount = theDesc->Length();
TCollection_AsciiString aCommand;
- while (anArgIndex < anArgsCount)
+ for (Standard_Integer anArgIndex = theDesc->Lower(); anArgIndex <= theDesc->Upper(); )
{
- aCommand = myArrayDescription->Value (anArgIndex);
+ aCommand = theDesc->Value (anArgIndex);
aCommand.LowerCase();
+ if (CheckInputCommand ("-deinterleaved", theDesc, anArgIndex, 0, anArgsCount))
+ {
+ anArrayFlags |= Graphic3d_ArrayFlags_AttribsDeinterleaved;
+ }
+ else if (CheckInputCommand ("-mutable", theDesc, anArgIndex, 0, anArgsCount))
+ {
+ anArrayFlags |= Graphic3d_ArrayFlags_AttribsMutable;
+ anArrayFlags |= Graphic3d_ArrayFlags_IndexesMutable;
+ }
// vertex command
- if (CheckInputCommand ("v", myArrayDescription, anArgIndex, 3, anArgsCount))
+ else if (CheckInputCommand ("v", theDesc, anArgIndex, 3, anArgsCount))
{
// vertex has a normal or normal with color or texel
- if (CheckInputCommand ("n", myArrayDescription, anArgIndex, 3, anArgsCount))
- hasNormals = Standard_True;
+ if (CheckInputCommand ("n", theDesc, anArgIndex, 3, anArgsCount))
+ {
+ anArrayFlags = anArrayFlags | Graphic3d_ArrayFlags_VertexNormal;
+ }
// vertex has a color
- if (CheckInputCommand ("c", myArrayDescription, anArgIndex, 3, anArgsCount))
- hasVColors = Standard_True;
+ if (CheckInputCommand ("c", theDesc, anArgIndex, 3, anArgsCount))
+ {
+ anArrayFlags = anArrayFlags | Graphic3d_ArrayFlags_VertexColor;
+ }
// vertex has a texel
- if (CheckInputCommand ("t", myArrayDescription, anArgIndex, 2, anArgsCount))
- hasTexels = Standard_True;
+ if (CheckInputCommand ("t", theDesc, anArgIndex, 2, anArgsCount))
+ {
+ anArrayFlags = anArrayFlags | Graphic3d_ArrayFlags_VertexTexel;
+ }
aVertexNum++;
}
// bound command
- else if (CheckInputCommand ("b", myArrayDescription, anArgIndex, 1, anArgsCount))
+ else if (CheckInputCommand ("b", theDesc, anArgIndex, 1, anArgsCount))
{
// bound has color
- if (CheckInputCommand ("c", myArrayDescription, anArgIndex, 3, anArgsCount))
- hasBColors = Standard_True;
+ if (CheckInputCommand ("c", theDesc, anArgIndex, 3, anArgsCount))
+ {
+ anArrayFlags = anArrayFlags | Graphic3d_ArrayFlags_BoundColor;
+ }
aBoundNum++;
}
// edge command
- else if (CheckInputCommand ("e", myArrayDescription, anArgIndex, 1, anArgsCount))
+ else if (CheckInputCommand ("e", theDesc, anArgIndex, 1, anArgsCount))
{
aEdgeNum++;
}
anArgIndex++;
}
- Handle(Graphic3d_ArrayOfPrimitives) anArray;
- if (anArrayType == "points")
+ if (myPArray.IsNull())
{
- anArray = new Graphic3d_ArrayOfPoints (aVertexNum);
+ myPArray = Graphic3d_ArrayOfPrimitives::CreateArray (thePrimType, aVertexNum, aBoundNum, aEdgeNum, anArrayFlags);
}
- else if (anArrayType == "segments")
- anArray = new Graphic3d_ArrayOfSegments (aVertexNum, aEdgeNum, hasVColors);
- else if (anArrayType == "polylines")
- anArray = new Graphic3d_ArrayOfPolylines (aVertexNum, aBoundNum, aEdgeNum,
- hasVColors, hasBColors);
- else if (anArrayType == "triangles")
- anArray = new Graphic3d_ArrayOfTriangles (aVertexNum, aEdgeNum, hasNormals,
- hasVColors, hasTexels);
- else if (anArrayType == "trianglefans")
- anArray = new Graphic3d_ArrayOfTriangleFans (aVertexNum, aBoundNum,
- hasNormals, hasVColors,
- hasBColors, hasTexels);
- else if (anArrayType == "trianglestrips")
- anArray = new Graphic3d_ArrayOfTriangleStrips (aVertexNum, aBoundNum,
- hasNormals, hasVColors,
- hasBColors, hasTexels);
- else if (anArrayType == "quads")
- anArray = new Graphic3d_ArrayOfQuadrangles (aVertexNum, aEdgeNum,
- hasNormals, hasVColors,
- hasTexels);
- else if (anArrayType == "quadstrips")
- anArray = new Graphic3d_ArrayOfQuadrangleStrips (aVertexNum, aBoundNum,
- hasNormals, hasVColors,
- hasBColors, hasTexels);
- else if (anArrayType == "polygons")
- anArray = new Graphic3d_ArrayOfPolygons (aVertexNum, aBoundNum, aEdgeNum,
- hasNormals, hasVColors, hasBColors,
- hasTexels);
+ else
+ {
+ if (myPArray->Type() != thePrimType
+ || aVertexNum > myPArray->VertexNumberAllocated()
+ || aEdgeNum > myPArray->EdgeNumberAllocated()
+ || aBoundNum > myPArray->BoundNumberAllocated()
+ || !myPArray->Attributes()->IsMutable()
+ || (!myPArray->Indices().IsNull() && !myPArray->Indices()->IsMutable()))
+ {
+ std::cout << "Syntax error: array cannot be patched\n";
+ return Standard_False;
+ }
- anArgIndex = 1;
- while (anArgIndex < anArgsCount)
+ myPArray->Attributes()->NbElements = aVertexNum;
+ if (Handle(Graphic3d_AttribBuffer) anAttribs = Handle(Graphic3d_AttribBuffer)::DownCast (myPArray->Attributes()))
+ {
+ anAttribs->Invalidate (0, aVertexNum - 1);
+ }
+ if (!myPArray->Indices().IsNull())
+ {
+ myPArray->Indices()->NbElements = aEdgeNum;
+ }
+ if (!myPArray->Bounds().IsNull())
+ {
+ myPArray->Bounds()->NbBounds = aBoundNum;
+ }
+ }
+
+ Standard_Integer aVertIndex = 0;
+ for (Standard_Integer anArgIndex = theDesc->Lower(); anArgIndex <= theDesc->Upper(); )
{
- aCommand = myArrayDescription->Value (anArgIndex);
+ aCommand = theDesc->Value (anArgIndex);
aCommand.LowerCase();
- if (!aCommand.IsAscii())
+ if (!aCommand.IsAscii()
+ || aCommand.IsEmpty())
+ {
break;
+ }
+ // skip beautifiers (syntax is not actually validated)
+ if (aCommand == "-deinterleaved"
+ || aCommand == "-mutable"
+ || aCommand.Value (1) == '('
+ || aCommand.Value (1) == ')'
+ || aCommand.Value (1) == ',')
+ {
+ ++anArgIndex;
+ }
// vertex command
- if (CheckInputCommand ("v", myArrayDescription, anArgIndex, 3, anArgsCount))
+ else if (CheckInputCommand ("v", theDesc, anArgIndex, 3, anArgsCount))
{
- anArray->AddVertex (myArrayDescription->Value (anArgIndex - 3).RealValue(),
- myArrayDescription->Value (anArgIndex - 2).RealValue(),
- myArrayDescription->Value (anArgIndex - 1).RealValue());
- const Standard_Integer aVertIndex = anArray->VertexNumber();
+ const Graphic3d_Vec3 aVert ((float )theDesc->Value (anArgIndex - 3).RealValue(),
+ (float )theDesc->Value (anArgIndex - 2).RealValue(),
+ (float )theDesc->Value (anArgIndex - 1).RealValue());
+ if ((anArrayFlags & Graphic3d_ArrayFlags_AttribsDeinterleaved) != 0
+ || (anArrayFlags & Graphic3d_ArrayFlags_AttribsMutable) != 0)
+ {
+ ++aVertIndex;
+ myPArray->SetVertice (aVertIndex, aVert.x(), aVert.y(), aVert.z());
+ }
+ else
+ {
+ aVertIndex = myPArray->AddVertex (aVert);
+ }
// vertex has a normal or normal with color or texel
- if (CheckInputCommand ("n", myArrayDescription, anArgIndex, 3, anArgsCount))
- anArray->SetVertexNormal (aVertIndex,
- myArrayDescription->Value (anArgIndex - 3).RealValue(),
- myArrayDescription->Value (anArgIndex - 2).RealValue(),
- myArrayDescription->Value (anArgIndex - 1).RealValue());
-
- if (CheckInputCommand ("c", myArrayDescription, anArgIndex, 3, anArgsCount))
- anArray->SetVertexColor (aVertIndex,
- myArrayDescription->Value (anArgIndex - 3).RealValue(),
- myArrayDescription->Value (anArgIndex - 2).RealValue(),
- myArrayDescription->Value (anArgIndex - 1).RealValue());
+ if (CheckInputCommand ("n", theDesc, anArgIndex, 3, anArgsCount))
+ {
+ const Graphic3d_Vec3 aNorm ((float )theDesc->Value (anArgIndex - 3).RealValue(),
+ (float )theDesc->Value (anArgIndex - 2).RealValue(),
+ (float )theDesc->Value (anArgIndex - 1).RealValue());
+ myPArray->SetVertexNormal (aVertIndex, aNorm.x(), aNorm.y(), aNorm.z());
+ }
- if (CheckInputCommand ("t", myArrayDescription, anArgIndex, 2, anArgsCount))
- anArray->SetVertexTexel (aVertIndex,
- myArrayDescription->Value (anArgIndex - 2).RealValue(),
- myArrayDescription->Value (anArgIndex - 1).RealValue());
+ if (CheckInputCommand ("c", theDesc, anArgIndex, 3, anArgsCount))
+ {
+ const Graphic3d_Vec3d aCol (theDesc->Value (anArgIndex - 3).RealValue(),
+ theDesc->Value (anArgIndex - 2).RealValue(),
+ theDesc->Value (anArgIndex - 1).RealValue());
+ myPArray->SetVertexColor (aVertIndex, aCol.r(), aCol.g(), aCol.b());
+ }
+ if (CheckInputCommand ("t", theDesc, anArgIndex, 2, anArgsCount))
+ {
+ const Graphic3d_Vec2 aTex ((float )theDesc->Value (anArgIndex - 2).RealValue(),
+ (float )theDesc->Value (anArgIndex - 1).RealValue());
+ myPArray->SetVertexTexel (aVertIndex, aTex.x(), aTex.y());
+ }
}
// bounds command
- else if (CheckInputCommand ("b", myArrayDescription, anArgIndex, 1, anArgsCount))
+ else if (CheckInputCommand ("b", theDesc, anArgIndex, 1, anArgsCount))
{
- Standard_Integer aVertCount = myArrayDescription->Value (anArgIndex - 1).IntegerValue();
+ Standard_Integer aVertCount = theDesc->Value (anArgIndex - 1).IntegerValue();
- if (CheckInputCommand ("c", myArrayDescription, anArgIndex, 3, anArgsCount))
- anArray->AddBound (aVertCount,
- myArrayDescription->Value (anArgIndex - 3).RealValue(),
- myArrayDescription->Value (anArgIndex - 2).RealValue(),
- myArrayDescription->Value (anArgIndex - 1).RealValue());
+ if (CheckInputCommand ("c", theDesc, anArgIndex, 3, anArgsCount))
+ myPArray->AddBound (aVertCount,
+ theDesc->Value (anArgIndex - 3).RealValue(),
+ theDesc->Value (anArgIndex - 2).RealValue(),
+ theDesc->Value (anArgIndex - 1).RealValue());
else
- anArray->AddBound (aVertCount);
+ myPArray->AddBound (aVertCount);
}
// edge command
- else if (CheckInputCommand ("e", myArrayDescription, anArgIndex, 1, anArgsCount))
+ else if (CheckInputCommand ("e", theDesc, anArgIndex, 1, anArgsCount))
{
- const Standard_Integer aVertIndex = myArrayDescription->Value (anArgIndex - 1).IntegerValue();
- anArray->AddEdge (aVertIndex);
+ const Standard_Integer anEdge = theDesc->Value (anArgIndex - 1).IntegerValue();
+ myPArray->AddEdge (anEdge);
}
// unknown command
else
- anArgIndex++;
+ {
+ std::cout << "Syntax error: unknown argument '" << theDesc->Value(anArgIndex) << "'\n";
+ return Standard_False;
+ }
+ }
+ return Standard_True;
+}
+
+//=======================================================================
+// function : SetColor
+// purpose :
+//=======================================================================
+void MyPArrayObject::SetColor (const Quantity_Color& theColor)
+{
+ AIS_InteractiveObject::SetColor (theColor);
+ setColorForShadingAspect (theColor);
+ if (myMarkerAspect)
+ {
+ myMarkerAspect->SetColor (theColor);
}
- myPArray = anArray;
+ SynchronizeAspects();
}
void MyPArrayObject::ComputeSelection (const Handle(SelectMgr_Selection)& theSelection,
}
bool MyPArrayObject::CheckInputCommand (const TCollection_AsciiString theCommand,
- const Handle(TColStd_HArray1OfAsciiString) theArgsArray,
+ const Handle(TColStd_HArray1OfAsciiString)& theArgsArray,
Standard_Integer &theArgIndex,
Standard_Integer theArgCount,
Standard_Integer theMaxArgs)
return true;
}
+//=======================================================================
+// function : setColorForShadingAspect
+// purpose :
+//=======================================================================
+void MyPArrayObject::setColorForShadingAspect (const Quantity_Color& theColor)
+{
+ if (myDrawer->SetupOwnShadingAspect())
+ {
+ replaceShadingAspect();
+ }
+ myDrawer->ShadingAspect()->SetColor (theColor);
+}
+
+//=======================================================================
+// function : replaceShadingAspect
+// purpose :
+//=======================================================================
+void MyPArrayObject::replaceShadingAspect()
+{
+ if (!myDrawer->Link())
+ {
+ return;
+ }
+ Graphic3d_MapOfAspectsToAspects anAspectReplacementMap;
+ anAspectReplacementMap.Bind (myDrawer->Link()->ShadingAspect()->Aspect(), myDrawer->ShadingAspect()->Aspect());
+ replaceAspects (anAspectReplacementMap);
+}
+
//=============================================================================
//function : VDrawPArray
//purpose : Draws primitives array from list of vertexes, bounds, edges
}
// read the arguments
- Standard_Integer aArgIndex = 1;
- TCollection_AsciiString aName (argv[aArgIndex++]);
- TCollection_AsciiString anArrayType (argv[aArgIndex++]);
+ Standard_Integer anArgIndex = 1;
+ TCollection_AsciiString aName (argv[anArgIndex++]);
+ TCollection_AsciiString anArrayType (argv[anArgIndex++]);
+ anArrayType.LowerCase();
+ Handle(MyPArrayObject) aPObject;
if (anArrayType == "-shape")
{
- Standard_CString aShapeName = argv[aArgIndex++];
+ Standard_CString aShapeName = argv[anArgIndex++];
TopoDS_Shape aShape = DBRep::Get (aShapeName);
Handle(Graphic3d_ArrayOfPrimitives) aTris = StdPrs_ShadedShape::FillTriangles (aShape);
if (aShape.IsNull())
return 1;
}
- Handle(MyPArrayObject) aPObject = new MyPArrayObject (aTris);
+ aPObject = new MyPArrayObject (aTris);
ViewerTest::Display (aName, aPObject);
return 0;
}
+ else if (anArrayType == "-patch"
+ || anArrayType == "-modify"
+ || anArrayType == "-edit")
+ {
+ if (argc >= 3)
+ {
+ anArrayType = argv[anArgIndex++];
+ anArrayType.LowerCase();
+ }
- Standard_Boolean hasVertex = Standard_False;
+ if (GetMapOfAIS().IsBound2 (aName))
+ {
+ aPObject = Handle(MyPArrayObject)::DownCast (GetMapOfAIS().Find2 (aName));
+ }
+ if (aPObject.IsNull())
+ {
+ std::cout << "Syntax error: object '" << aName << "' cannot be found\n";
+ return 1;
+ }
+ }
- Handle(TColStd_HArray1OfAsciiString) anArgsArray = new TColStd_HArray1OfAsciiString (0, argc - 2);
- anArgsArray->SetValue (0, anArrayType);
+ Standard_Boolean hasVertex = Standard_False;
- if (anArrayType != "points" &&
- anArrayType != "segments" &&
- anArrayType != "polylines" &&
- anArrayType != "triangles" &&
- anArrayType != "trianglefans" &&
- anArrayType != "trianglestrips" &&
- anArrayType != "quads" &&
- anArrayType != "quadstrips" &&
- anArrayType != "polygons")
+ Graphic3d_TypeOfPrimitiveArray aPrimType = Graphic3d_TOPA_UNDEFINED;
+ if (anArrayType == "points")
+ {
+ aPrimType = Graphic3d_TOPA_POINTS;
+ }
+ else if (anArrayType == "segments")
+ {
+ aPrimType = Graphic3d_TOPA_SEGMENTS;
+ }
+ else if (anArrayType == "polylines")
+ {
+ aPrimType = Graphic3d_TOPA_POLYLINES;
+ }
+ else if (anArrayType == "triangles")
+ {
+ aPrimType = Graphic3d_TOPA_TRIANGLES;
+ }
+ else if (anArrayType == "trianglefans")
+ {
+ aPrimType = Graphic3d_TOPA_TRIANGLEFANS;
+ }
+ else if (anArrayType == "trianglestrips")
+ {
+ aPrimType = Graphic3d_TOPA_TRIANGLESTRIPS;
+ }
+ else if (anArrayType == "quads")
+ {
+ aPrimType = Graphic3d_TOPA_QUADRANGLES;
+ }
+ else if (anArrayType == "quadstrips")
+ {
+ aPrimType = Graphic3d_TOPA_QUADRANGLESTRIPS;
+ }
+ else if (anArrayType == "polygons")
+ {
+ aPrimType = Graphic3d_TOPA_POLYGONS;
+ }
+ if (aPrimType == Graphic3d_TOPA_UNDEFINED)
{
- di << "Unexpected type of primitives array\n";
+ std::cout << "Syntax error: unexpected type of primitives array\n";
return 1;
}
- TCollection_AsciiString aCommand;
- for (Standard_Integer anArgIndex = 3; anArgIndex < argc; anArgIndex++)
+ Standard_Integer aLowerArg = anArgIndex;
+ Handle(TColStd_HArray1OfAsciiString) anArgsArray = new TColStd_HArray1OfAsciiString (0, argc - 3);
+ for (; anArgIndex < argc; ++anArgIndex)
{
- aCommand = argv[anArgIndex];
+ TCollection_AsciiString aCommand (argv[anArgIndex]);
aCommand.LowerCase();
if (!aCommand.IsAscii())
{
- di << "Unexpected argument: #" << aArgIndex - 1 << " , "
+ di << "Unexpected argument: #" << anArgIndex - 1 << " , "
<< "should be an array element: 'v', 'b', 'e' \n";
break;
}
hasVertex = Standard_True;
}
- anArgsArray->SetValue (anArgIndex - 2, aCommand);
+ anArgsArray->SetValue (anArgIndex - aLowerArg, aCommand);
}
if (!hasVertex)
}
Handle(Graphic3d_AspectMarker3d) anAspPoints;
- if (anArrayType == "points")
+ if (aPrimType == Graphic3d_TOPA_POINTS)
{
anAspPoints = new Graphic3d_AspectMarker3d (Aspect_TOM_POINT, Quantity_NOC_YELLOW, 1.0f);
}
// create primitives array object
- Handle(MyPArrayObject) aPObject = new MyPArrayObject (anArgsArray, anAspPoints);
-
- // register the object in map
- VDisplayAISObject (aName, aPObject);
-
+ if (aPObject.IsNull())
+ {
+ // register the object in map
+ aPObject = new MyPArrayObject (aPrimType, anArgsArray, anAspPoints);
+ VDisplayAISObject (aName, aPObject);
+ }
+ else
+ {
+ aPObject->Init (aPrimType, anArgsArray, anAspPoints, Standard_True);
+ ViewerTest::CurrentView()->Redraw();
+ }
return 0;
}
return 0;
}
-//===============================================================================================
-//function : VSetSelectionMode
-//purpose : vselmode
-//===============================================================================================
-static Standard_Integer VSetSelectionMode (Draw_Interpretor& /*di*/,
- Standard_Integer theNbArgs,
- const char** theArgv)
+//=======================================================================
+//function : VChild
+//purpose :
+//=======================================================================
+static Standard_Integer VChild (Draw_Interpretor& ,
+ Standard_Integer theNbArgs,
+ const char** theArgVec)
{
- // Check errors
- Handle(AIS_InteractiveContext) anAISContext = ViewerTest::GetAISContext();
- if (anAISContext.IsNull())
+ Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
+ if (aContext.IsNull())
{
- std::cout << "Error: no active Viewer\n";
+ std::cout << "Error: no active view\n";
return 1;
}
- NCollection_Sequence<TCollection_AsciiString> anObjNames;
- Standard_Integer aSelectionMode = -1;
- Standard_Boolean toTurnOn = Standard_True;
- AIS_SelectionModesConcurrency aSelModeConcurrency = AIS_SelectionModesConcurrency_GlobalOrLocal;
+ int toAdd = -1;
+ Handle(AIS_InteractiveObject) aParent;
+ bool hasActions = false;
+ int toInheritTrsf = -1;
+ ViewerTest_AutoUpdater anUpdateTool (aContext, ViewerTest::CurrentView());
for (Standard_Integer anArgIter = 1; anArgIter < theNbArgs; ++anArgIter)
{
- TCollection_AsciiString anArgCase (theArgv[anArgIter]);
- anArgCase.LowerCase();
- if (anArgCase == "-set"
- || anArgCase == "-replace"
- || anArgCase == "-single"
- || anArgCase == "-exclusive")
- {
- aSelModeConcurrency = AIS_SelectionModesConcurrency_Single;
- }
- else if (anArgCase == "-add"
- || anArgCase == "-combine"
- || anArgCase == "-combination"
- || anArgCase == "-multiple")
+ TCollection_AsciiString anArg (theArgVec[anArgIter]);
+ anArg.LowerCase();
+ if (anUpdateTool.parseRedrawMode (anArg))
{
- aSelModeConcurrency = AIS_SelectionModesConcurrency_Multiple;
+ continue;
}
- else if (anArgCase == "-globalorlocal"
- || anArgCase == "-localorglobal")
+ else if (anArg == "-add")
{
- aSelModeConcurrency = AIS_SelectionModesConcurrency_GlobalOrLocal;
+ toAdd = 1;
+ continue;
}
- else
+ else if (anArg == "-remove")
{
- anObjNames.Append (theArgv[anArgIter]);
+ toAdd = 0;
+ continue;
}
- }
+ else if (anArg == "-inheritparenttrsf"
+ || anArg == "-inheritparentloc"
+ || anArg == "-inheritparentlocation"
+ || anArg == "-inheritparent"
+ || anArg == "-noinheritparenttrsf"
+ || anArg == "-noinheritparentloc"
+ || anArg == "-noinheritparentlocation"
+ || anArg == "-noinheritparent"
+ || anArg == "-ignoreparenttrsf"
+ || anArg == "-ignoreparentloc"
+ || anArg == "-ignoreparentlocation"
+ || anArg == "-ignoreparent")
+ {
+ bool aVal = true;
+ if (anArgIter + 1 < theNbArgs
+ && ViewerTest::ParseOnOff(theArgVec[anArgIter + 1], aVal))
+ {
+ ++anArgIter;
+ }
+ if (anArg.StartsWith("-no")
+ || anArg.StartsWith("-ignore"))
+ {
+ aVal = !aVal;
+ }
+ toInheritTrsf = aVal ? 1 : 0;
+ continue;
+ }
+
+ Handle(AIS_InteractiveObject) aChild;
+ if (!GetMapOfAIS().Find2 (theArgVec[anArgIter], aChild))
+ {
+ std::cout << "Syntax error: object '" << theArgVec[anArgIter] << "' is not found\n";
+ return 1;
+ }
+
+ if (aParent.IsNull())
+ {
+ aParent = aChild;
+ }
+ else if (toAdd == -1)
+ {
+ std::cout << "Syntax error: no action specified\n";
+ return 1;
+ }
+ else
+ {
+ hasActions = true;
+ if (toAdd == 1)
+ {
+ if(toInheritTrsf == 0)
+ aParent->AddChildWithCurrentTransformation(aChild);
+ else
+ aParent->AddChild (aChild);
+ }
+ else
+ {
+ if (toInheritTrsf == 0)
+ aParent->RemoveChildWithRestoreTransformation(aChild);
+ else
+ aParent->RemoveChild (aChild);
+ }
+ }
+ }
+ if (!hasActions)
+ {
+ std::cout << "Syntax error: not enough arguments\n";
+ return 1;
+ }
+ return 0;
+}
+
+//=======================================================================
+//function : VParent
+//purpose :
+//=======================================================================
+static Standard_Integer VParent(Draw_Interpretor&,
+ Standard_Integer theNbArgs,
+ const char** theArgVec)
+{
+ Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
+ if (aContext.IsNull())
+ {
+ std::cout << "Error: no active view\n";
+ return 1;
+ }
+
+ if (theNbArgs < 2 )
+ {
+ std::cout << theArgVec[0] << " error: expect at least 2 arguments\n";
+ return 1;
+ }
+
+ TCollection_AsciiString aName(theArgVec[1]);
+ Handle(AIS_InteractiveObject) aParent;
+ if (!GetMapOfAIS().Find2(theArgVec[1], aParent))
+ {
+ std::cout << "Syntax error: object '" << theArgVec[1] << "' is not found\n";
+ return 1;
+ }
+
+ ViewerTest_AutoUpdater anUpdateTool(aContext, ViewerTest::CurrentView());
+ for (Standard_Integer anArgIter = 2; anArgIter < theNbArgs; ++anArgIter)
+ {
+ TCollection_AsciiString anArg(theArgVec[anArgIter]);
+ anArg.LowerCase();
+ if (anArg == "-ignorevisu")
+ aParent->SetPropagateVisualState(Standard_False);
+ }
+ return 0;
+}
+
+//===============================================================================================
+//function : VSetSelectionMode
+//purpose : vselmode
+//===============================================================================================
+static Standard_Integer VSetSelectionMode (Draw_Interpretor& /*di*/,
+ Standard_Integer theNbArgs,
+ const char** theArgv)
+{
+ // Check errors
+ Handle(AIS_InteractiveContext) anAISContext = ViewerTest::GetAISContext();
+ if (anAISContext.IsNull())
+ {
+ std::cout << "Error: no active Viewer\n";
+ return 1;
+ }
+
+ NCollection_Sequence<TCollection_AsciiString> anObjNames;
+ Standard_Integer aSelectionMode = -1;
+ Standard_Boolean toTurnOn = Standard_True;
+ AIS_SelectionModesConcurrency aSelModeConcurrency = AIS_SelectionModesConcurrency_GlobalOrLocal;
+ for (Standard_Integer anArgIter = 1; anArgIter < theNbArgs; ++anArgIter)
+ {
+ TCollection_AsciiString anArgCase (theArgv[anArgIter]);
+ anArgCase.LowerCase();
+ if (anArgCase == "-set"
+ || anArgCase == "-replace"
+ || anArgCase == "-single"
+ || anArgCase == "-exclusive")
+ {
+ aSelModeConcurrency = AIS_SelectionModesConcurrency_Single;
+ }
+ else if (anArgCase == "-add"
+ || anArgCase == "-combine"
+ || anArgCase == "-combination"
+ || anArgCase == "-multiple")
+ {
+ aSelModeConcurrency = AIS_SelectionModesConcurrency_Multiple;
+ }
+ else if (anArgCase == "-globalorlocal"
+ || anArgCase == "-localorglobal")
+ {
+ aSelModeConcurrency = AIS_SelectionModesConcurrency_GlobalOrLocal;
+ }
+ else
+ {
+ anObjNames.Append (theArgv[anArgIter]);
+ }
+ }
if (anObjNames.Size() < 2
|| !ViewerTest::ParseOnOff (anObjNames.Last().ToCString(), toTurnOn))
{
aPrims->AddVertex (aPnts[aPntIter]);
}
- ViewerTest::Display (argv[1], new MyPArrayObject (aPrims));
+ Handle(AIS_InteractiveObject) aPrs = new MyPArrayObject (aPrims);
+ if (!isTri)
+ {
+ aPrs->Attributes()->SetupOwnShadingAspect();
+ aPrs->Attributes()->ShadingAspect()->Aspect()->SetColor (aPrs->Attributes()->LineAspect()->Aspect()->Color());
+ }
+ ViewerTest::Display (argv[1], aPrs);
return 0;
}
return 0;
}
-//=======================================================================
-//function : VShowFaceBoundaries
-//purpose : Set face boundaries drawing on/off for ais object
-//=======================================================================
-static Standard_Integer VShowFaceBoundary (Draw_Interpretor& /*di*/,
- Standard_Integer argc,
- const char ** argv)
-{
- Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext ();
- if (aContext.IsNull ())
- {
- std::cout << argv[0] << " Call 'vinit' before!\n";
- return 1;
- }
-
- if ((argc != 3 && argc < 6) || argc > 8)
- {
- std::cout << "Usage :\n " << argv[0]
- << " ObjectName isOn [R G B [LineWidth [LineStyle]]]\n"
- << " ObjectName - name of AIS interactive object. \n"
- << " if ObjectName = \"\", then set as default\n"
- << " settings for all newly displayed objects\n"
- << " isOn - flag indicating whether the boundaries\n"
- << " should be turned on or off (can be set\n"
- << " to 0 (off) or 1 (on)).\n"
- << " R, G, B - red, green and blue components of boundary\n"
- << " color in range (0 - 255).\n"
- << " (default is (0, 0, 0)\n"
- << " LineWidth - line width\n"
- << " (default is 1)\n"
- << " LineStyle - line fill style :\n"
- << " 0 - solid \n"
- << " 1 - dashed \n"
- << " 2 - dot \n"
- << " 3 - dashdot\n"
- << " (default is solid)";
- return 1;
- }
-
- TCollection_AsciiString aName (argv[1]);
-
- Standard_Real aRed = 0.0;
- Standard_Real aGreen = 0.0;
- Standard_Real aBlue = 0.0;
- Standard_Real aWidth = 1.0;
- Aspect_TypeOfLine aLineType = Aspect_TOL_SOLID;
-
- // find object
- Handle(AIS_InteractiveObject) anInterObj;
-
- // if name is empty - apply attributes for default aspect
- if (!aName.IsEmpty ())
- {
- if (!GetMapOfAIS().Find2 (aName, anInterObj)
- || anInterObj.IsNull())
- {
- std::cout << "Use 'vdisplay' on " << aName << " before" << std::endl;
- return 1;
- }
- }
-
- const Handle(Prs3d_Drawer)& aDrawer = (aName.IsEmpty ()) ?
- TheAISContext ()->DefaultDrawer () : anInterObj->Attributes ();
-
- // turn boundaries on/off
- Standard_Boolean isBoundaryDraw = (Draw::Atoi (argv[2]) == 1);
- aDrawer->SetFaceBoundaryDraw (isBoundaryDraw);
-
- // set boundary line color
- if (argc >= 6)
- {
- // Text color
- aRed = Draw::Atof (argv[3])/255.;
- aGreen = Draw::Atof (argv[4])/255.;
- aBlue = Draw::Atof (argv[5])/255.;
- }
-
- // set line width
- if (argc >= 7)
- {
- aWidth = (Standard_Real)Draw::Atof (argv[6]);
- }
-
- // select appropriate line type
- if (argc == 8)
- {
- if (!ViewerTest::ParseLineType (argv[7], aLineType))
- {
- std::cout << "Syntax error: unknown line type '" << argv[7] << "'\n";
- return 1;
- }
- }
-
- Quantity_Color aColor (aRed, aGreen, aBlue, Quantity_TOC_RGB);
-
- Handle(Prs3d_LineAspect) aBoundaryAspect =
- new Prs3d_LineAspect (aColor, aLineType, aWidth);
-
- aDrawer->SetFaceBoundaryAspect (aBoundaryAspect);
-
- TheAISContext()->Redisplay (anInterObj, Standard_True);
-
- return 0;
-}
-
// This class is used for testing markers.
-
class ViewerTest_MarkersArrayObject : public AIS_InteractiveObject
{
return 0;
}
-//! Auxiliary function to parse font aspect style argument
-static Standard_Boolean parseFontStyle (const TCollection_AsciiString& theArg,
- Font_FontAspect& theAspect)
-{
- if (theArg == "regular"
- || *theArg.ToCString() == 'r')
- {
- theAspect = Font_FA_Regular;
- return Standard_True;
- }
- else if (theArg == "bolditalic")
- {
- theAspect = Font_FA_BoldItalic;
- return Standard_True;
- }
- else if (theArg == "bold"
- || *theArg.ToCString() == 'b')
- {
- theAspect = Font_FA_Bold;
- return Standard_True;
- }
- else if (theArg == "italic"
- || *theArg.ToCString() == 'i')
- {
- theAspect = Font_FA_Italic;
- return Standard_True;
- }
- return Standard_False;
-}
-
-//! Auxiliary function
-static TCollection_AsciiString fontStyleString (const Font_FontAspect theAspect)
-{
- switch (theAspect)
- {
- case Font_FA_Regular: return "regular";
- case Font_FA_BoldItalic: return "bolditalic";
- case Font_FA_Bold: return "bold";
- case Font_FA_Italic: return "italic";
- default: return "undefined";
- }
-}
-
//=======================================================================
//function : TextToBrep
//purpose : Tool for conversion text to occt-shapes
Graphic3d_HorizontalTextAlignment aHJustification = Graphic3d_HTA_LEFT;
Graphic3d_VerticalTextAlignment aVJustification = Graphic3d_VTA_BOTTOM;
-
+ Font_StrictLevel aStrictLevel = Font_StrictLevel_Any;
for (; anArgIt < theArgNb; ++anArgIt)
{
TCollection_AsciiString aParam (theArgVec[anArgIt]);
TCollection_AsciiString anOption (theArgVec[anArgIt]);
anOption.LowerCase();
-
- if (anOption.IsEqual ("regular"))
+ if (!parseFontStyle (anOption, aFontAspect))
{
- aFontAspect = Font_FA_Regular;
- }
- else if (anOption.IsEqual ("bold"))
- {
- aFontAspect = Font_FA_Bold;
- }
- else if (anOption.IsEqual ("italic"))
- {
- aFontAspect = Font_FA_Italic;
- }
- else if (anOption.IsEqual ("bolditalic"))
- {
- aFontAspect = Font_FA_BoldItalic;
- }
- else
- {
- std::cout << "Error: wrong syntax at '" << aParam.ToCString() << "'.\n";
+ std::cout << "Error: unknown font aspect '" << anOption << "'.\n";
return 1;
}
}
aFontName = theArgVec[anArgIt];
}
+ else if (aParam == "-strict")
+ {
+ anArgIt += parseFontStrictLevel (theArgNb - anArgIt - 1,
+ theArgVec + anArgIt + 1,
+ aStrictLevel);
+ }
else if (aParam == "-composite")
{
if (++anArgIt >= theArgNb)
}
aFont.SetCompositeCurveMode (anIsCompositeCurve);
- if (!aFont.Init (aFontName.ToCString(), aFontAspect, aTextHeight))
+ if (!aFont.FindAndInit (aFontName.ToCString(), aFontAspect, aTextHeight, aStrictLevel))
{
- std::cerr << "Font initialization error\n";
+ std::cout << "Error: unable to load Font\n";
return 1;
}
//function : VFont
//purpose : Font management
//=======================================================================
+struct FontComparator
+{
+ bool operator() (const Handle(Font_SystemFont)& theFontA,
+ const Handle(Font_SystemFont)& theFontB)
+ {
+ return theFontA->FontKey().IsLess (theFontB->FontKey());
+ }
+};
static int VFont (Draw_Interpretor& theDI,
Standard_Integer theArgNb,
{
// just print the list of available fonts
Standard_Boolean isFirst = Standard_True;
- for (Font_NListOfSystemFont::Iterator anIter (aMgr->GetAvailableFonts());
- anIter.More(); anIter.Next())
+ const Font_NListOfSystemFont aFonts = aMgr->GetAvailableFonts();
+ std::vector<Handle(Font_SystemFont)> aFontsSorted;
+ aFontsSorted.reserve (aFonts.Size());
+ for (Font_NListOfSystemFont::Iterator aFontIter (aFonts); aFontIter.More(); aFontIter.Next())
{
- const Handle(Font_SystemFont)& aFont = anIter.Value();
+ aFontsSorted.push_back (aFontIter.Value());
+ }
+ std::stable_sort (aFontsSorted.begin(), aFontsSorted.end(), FontComparator());
+ for (std::vector<Handle(Font_SystemFont)>::iterator aFontIter = aFontsSorted.begin(); aFontIter != aFontsSorted.end(); ++aFontIter)
+ {
+ const Handle(Font_SystemFont)& aFont = *aFontIter;
if (!isFirst)
{
theDI << "\n";
}
- theDI << aFont->FontName()->String()
- << " " << fontStyleString (aFont->FontAspect())
- << " " << aFont->FontPath()->String();
+ theDI << aFont->ToString();
isFirst = Standard_False;
}
return 0;
}
+ Font_StrictLevel aStrictLevel = Font_StrictLevel_Any;
for (Standard_Integer anArgIter = 1; anArgIter < theArgNb; ++anArgIter)
{
const TCollection_AsciiString anArg (theArgVec[anArgIter]);
TCollection_AsciiString anArgCase (anArg);
anArgCase.LowerCase();
- if (anArgCase == "find")
+ if (anArgCase == "-strict")
{
- if (++anArgIter >= theArgNb)
- {
- std::cerr << "Wrong syntax at argument '" << anArg.ToCString() << "'!\n";
- return 1;
- }
-
- Standard_CString aFontName = theArgVec[anArgIter];
+ anArgIter += parseFontStrictLevel (theArgNb - anArgIter - 1,
+ theArgVec + anArgIter + 1,
+ aStrictLevel);
+ }
+ else if (anArgIter + 1 < theArgNb
+ && (anArgCase == "-find"
+ || anArgCase == "find"))
+ {
+ Standard_CString aFontName = theArgVec[++anArgIter];
Font_FontAspect aFontAspect = Font_FA_Undefined;
if (++anArgIter < theArgNb)
{
--anArgIter;
}
}
- Handle(Font_SystemFont) aFont = aMgr->FindFont (new TCollection_HAsciiString (aFontName), aFontAspect, -1);
- if (aFont.IsNull())
+
+ if (Handle(Font_SystemFont) aFont = aMgr->FindFont (aFontName, aStrictLevel, aFontAspect))
{
- std::cerr << "Error: font '" << aFontName << "' is not found!\n";
- continue;
+ theDI << aFont->ToString();
}
-
- theDI << aFont->FontName()->String()
- << " " << fontStyleString (aFont->FontAspect())
- << " " << aFont->FontPath()->String();
- }
- else if (anArgCase == "add"
- || anArgCase == "register")
- {
- if (++anArgIter >= theArgNb)
+ else
{
- std::cerr << "Error: wrong syntax at argument '" << anArg << "'!\n";
- return 1;
+ std::cout << "Error: font '" << aFontName << "' is not found!\n";
}
-
+ }
+ else if (anArgIter + 1 < theArgNb
+ && (anArgCase == "-add"
+ || anArgCase == "add"
+ || anArgCase == "-register"
+ || anArgCase == "register"))
+ {
+ ++anArgIter;
Standard_CString aFontPath = theArgVec[anArgIter++];
TCollection_AsciiString aFontName;
Font_FontAspect aFontAspect = Font_FA_Undefined;
{
anArgCase = theArgVec[anArgIter];
anArgCase.LowerCase();
- if (aFontAspect == Font_FA_Undefined
+ if (aFontAspect == Font_FontAspect_UNDEFINED
&& parseFontStyle (anArgCase, aFontAspect))
{
continue;
continue;
}
- if (aFontAspect != Font_FA_Undefined
+ if (aFontAspect != Font_FontAspect_UNDEFINED
|| !aFontName.IsEmpty())
{
- if (aFontAspect == Font_FA_Undefined)
+ TCollection_AsciiString aName = aFont->FontName();
+ if (!aFontName.IsEmpty())
{
- aFontAspect = aFont->FontAspect();
+ aName = aFontName;
}
- Handle(TCollection_HAsciiString) aName = aFont->FontName();
- if (!aFontName.IsEmpty())
+ Handle(Font_SystemFont) aFont2 = new Font_SystemFont (aName);
+ if (aFontAspect != Font_FontAspect_UNDEFINED)
{
- aName = new TCollection_HAsciiString (aFontName);
+ aFont2->SetFontPath (aFontAspect, aFontPath);
}
- aFont = new Font_SystemFont (aName, aFontAspect, new TCollection_HAsciiString (aFontPath));
+ else
+ {
+ for (int anAspectIter = 0; anAspectIter < Font_FontAspect_NB; ++anAspectIter)
+ {
+ aFont2->SetFontPath ((Font_FontAspect )anAspectIter, aFont->FontPath ((Font_FontAspect )anAspectIter));
+ }
+ }
+ aFont = aFont2;
}
if (isSingelStroke != -1)
{
}
aMgr->RegisterFont (aFont, Standard_True);
- theDI << aFont->FontName()->String()
- << " " << fontStyleString (aFont->FontAspect())
- << " " << aFont->FontPath()->String();
+ theDI << aFont->ToString();
}
- else
+ else if (anArgCase == "-verbose"
+ || anArgCase == "-trace")
{
- std::cerr << "Warning! Unknown argument '" << anArg << "'\n";
- }
- }
-
- return 0;
-}
-
-//=======================================================================
-//function : VSetEdgeType
-//purpose : Edges type management
-//=======================================================================
-
-static int VSetEdgeType (Draw_Interpretor& theDI,
- Standard_Integer theArgNum,
- const char** theArgs)
-{
- if (theArgNum < 4 || theArgNum > 9)
- {
- theDI << theArgs[0] << " error: wrong number of parameters. Type 'help "
- << theArgs[0] << "' for more information.\n";
- return 1;
- }
-
- Standard_Boolean isForceRedisplay = Standard_False;
-
- // Get shape name
- TCollection_AsciiString aName(theArgs[1]);
- Handle(AIS_InteractiveObject) anObject;
- if (!GetMapOfAIS().Find2 (aName, anObject))
- {
- theDI << theArgs[0] << " error: wrong object name.\n";
- return 1;
- }
-
- // Enable triangle edge mode
- if (!anObject->Attributes()->HasOwnShadingAspect())
- {
- anObject->Attributes()->SetShadingAspect (new Prs3d_ShadingAspect());
- *anObject->Attributes()->ShadingAspect()->Aspect() = *anObject->Attributes()->Link()->ShadingAspect()->Aspect();
- }
- const Handle(Prs3d_ShadingAspect)& aFillAreaAspect = anObject->Attributes()->ShadingAspect();
- aFillAreaAspect->Aspect()->SetEdgeOn();
-
- // Parse parameters
- for (Standard_Integer anIt = 2; anIt < theArgNum; ++anIt)
- {
- TCollection_AsciiString aParam ((theArgs[anIt]));
- if (aParam.Value (1) == '-' && !aParam.IsRealValue())
- {
- if (aParam.IsEqual ("-type"))
- {
- if (theArgNum <= anIt + 1)
- {
- theDI << theArgs[0] << " error: wrong number of values for parameter '"
- << aParam.ToCString() << "'.\n";
- return 1;
- }
-
- ++anIt;
- Aspect_TypeOfLine aTypeEnum = Aspect_TOL_SOLID;
- if (!ViewerTest::ParseLineType (theArgs[anIt], aTypeEnum))
- {
- std::cout << "Syntax error: wrong line type: '" << theArgs[anIt] << "'.\n";
- return 1;
- }
- anObject->Attributes()->ShadingAspect()->Aspect()->SetEdgeLineType (aTypeEnum);
- }
- else if (aParam.IsEqual ("-color"))
- {
- if (theArgNum <= anIt + 3)
- {
- theDI << theArgs[0] << " error: wrong number of values for parameter '"
- << aParam.ToCString() << "'.\n";
- return 1;
- }
-
- Standard_Real aR = Draw::Atof(theArgs[++anIt]);
- Standard_Real aG = Draw::Atof(theArgs[++anIt]);
- Standard_Real aB = Draw::Atof(theArgs[++anIt]);
- Quantity_Color aColor = Quantity_Color (aR > 1 ? aR / 255.0 : aR,
- aG > 1 ? aG / 255.0 : aG,
- aB > 1 ? aB / 255.0 : aB,
- Quantity_TOC_RGB);
-
- aFillAreaAspect->Aspect()->SetEdgeColor (aColor);
- }
- else if (aParam.IsEqual ("-force"))
- {
- isForceRedisplay = Standard_True;
- }
- else
+ bool toEnable = true;
+ if (anArgIter + 1 < theArgNb
+ && ViewerTest::ParseOnOff (theArgVec[anArgIter + 1], toEnable))
{
- theDI << theArgs[0] << " error: unknown parameter '"
- << aParam.ToCString() << "'.\n";
- return 1;
+ ++anArgIter;
}
+ aMgr->SetTraceAliases (toEnable);
}
- }
-
- // Update shape presentation as aspect parameters were changed
- if (isForceRedisplay)
- {
- ViewerTest::GetAISContext()->Redisplay (anObject, Standard_False);
- }
- else
- {
- anObject->SetAspect (aFillAreaAspect);
- }
-
- //Update view
- ViewerTest::CurrentView()->Redraw();
-
- return 0;
-}
-
-//=======================================================================
-//function : VUnsetEdgeType
-//purpose : Unsets edges visibility in shading mode
-//=======================================================================
-
-static int VUnsetEdgeType (Draw_Interpretor& theDI,
- Standard_Integer theArgNum,
- const char** theArgs)
-{
- if (theArgNum != 2 && theArgNum != 3)
- {
- theDI << theArgs[0] << " error: wrong number of parameters. Type 'help "
- << theArgs[0] << "' for more information.\n";
- return 1;
- }
-
- Standard_Boolean isForceRedisplay = Standard_False;
-
- // Get shape name
- TCollection_AsciiString aName (theArgs[1]);
- Handle(AIS_InteractiveObject) anObject;
- if (!GetMapOfAIS().Find2 (aName, anObject))
- {
- theDI << theArgs[0] << " error: wrong object name.\n";
- return 1;
- }
-
- // Enable trianle edge mode
- anObject->Attributes()->ShadingAspect()->Aspect()->SetEdgeOff();
-
- // Parse parameters
- if (theArgNum == 3)
- {
- TCollection_AsciiString aParam ((theArgs[2]));
- if (aParam.IsEqual ("-force"))
+ else if (anArgCase == "-unicodefallback"
+ || anArgCase == "-fallback"
+ || anArgCase == "-touseunicodesubsetfallback")
{
- isForceRedisplay = Standard_True;
+ bool toEnable = true;
+ if (anArgIter + 1 < theArgNb
+ && ViewerTest::ParseOnOff (theArgVec[anArgIter + 1], toEnable))
+ {
+ ++anArgIter;
+ }
+ Font_FontMgr::ToUseUnicodeSubsetFallback() = toEnable;
}
else
{
- theDI << theArgs[0] << " error: unknown parameter '"
- << aParam.ToCString() << "'.\n";
- return 1;
+ std::cerr << "Warning! Unknown argument '" << anArg << "'\n";
}
}
- // Update shape presentation as aspect parameters were changed
- if (isForceRedisplay)
- {
- ViewerTest::GetAISContext()->Redisplay (anObject, Standard_False);
- }
- else
- {
- anObject->SetAspect (anObject->Attributes()->ShadingAspect());
- }
-
- //Update view
- ViewerTest::CurrentView()->Redraw();
-
return 0;
}
-
//=======================================================================
//function : VVertexMode
//purpose : Switches vertex display mode for AIS_Shape or displays the current value
Standard_Boolean toRandColors = Standard_False;
Standard_Boolean hasNormals = Standard_True;
Standard_Boolean isSetArgNorm = Standard_False;
+ Standard_Boolean hasUV = Standard_False;
for (Standard_Integer anArgIter = 1; anArgIter < theArgNum; ++anArgIter)
{
Standard_CString anArg = theArgs[anArgIter];
isSetArgNorm = Standard_True;
hasNormals = Standard_False;
}
+ else if (aFlag == "-uv"
+ || aFlag == "-texels")
+ {
+ hasUV = Standard_True;
+ }
}
Standard_CString aName = theArgs[1];
+ Graphic3d_ArrayFlags aFlags = Graphic3d_ArrayFlags_None;
+ if (hasNormals)
+ {
+ aFlags |= Graphic3d_ArrayFlags_VertexNormal;
+ }
+ if (toRandColors)
+ {
+ aFlags |= Graphic3d_ArrayFlags_VertexColor;
+ }
+ if (hasUV)
+ {
+ aFlags |= Graphic3d_ArrayFlags_VertexTexel;
+ }
// generate arbitrary set of points
Handle(Graphic3d_ArrayOfPoints) anArrayPoints;
return 1;
}
- anArrayPoints = new Graphic3d_ArrayOfPoints (aNbPoints, toRandColors, hasNormals);
+ anArrayPoints = new Graphic3d_ArrayOfPoints (aNbPoints, aFlags);
for (TopExp_Explorer aFaceIt (aShape, TopAbs_FACE); aFaceIt.More(); aFaceIt.Next())
{
const TopoDS_Face& aFace = TopoDS::Face (aFaceIt.Current());
{
anArrayPoints->SetVertexNormal (anIndexOfPoint, aNormals (aNodeIter));
}
+ if (hasUV
+ && aTriangulation->HasUVNodes())
+ {
+ anArrayPoints->SetVertexTexel (anIndexOfPoint, aTriangulation->UVNode (aNodeIter));
+ }
}
}
}
gp_Pnt aCenter(aCenterX, aCenterY, aCenterZ);
- anArrayPoints = new Graphic3d_ArrayOfPoints (aNbPoints, toRandColors, hasNormals);
+ anArrayPoints = new Graphic3d_ArrayOfPoints (aNbPoints, aFlags);
for (Standard_Integer aPntIt = 0; aPntIt < aNbPoints; ++aPntIt)
{
Standard_Real anAlpha = (Standard_Real (rand() % 2000) / 1000.0) * M_PI;
{
anArrayPoints->SetVertexNormal (anIndexOfPoint, aDir);
}
+ if (hasUV)
+ {
+ anArrayPoints->SetVertexTexel (anIndexOfPoint, gp_Pnt2d (anAlpha / 2.0 * M_PI,
+ aBeta / 2.0 * M_PI));
+ }
}
}
"\n\t\t: trihedron, default state is XYZ"
"\n\t\t: -hideLabels allows to show/hide trihedron labels"
"\n\t\t: -hideArrows allows to show/hide trihedron arrows"
- "\n\t\t: -labels allows to change default X/Y/Z titles of axes"
+ "\n\t\t: -label allows to change default X/Y/Z titles of axes"
"\n\t\t: -attribute sets parameters of trihedron"
"\n\t\t: -color sets color properties of parts of trihedron"
"\n\t\t: -textColor sets color properties of trihedron labels"
"\n\t\t: [-angle angle=0]"
"\n\t\t: [-zoom {0|1}=0]"
"\n\t\t: [-height height=16]"
- "\n\t\t: [-aspect {regular|bold|italic|bolditalic}=regular]"
+ "\n\t\t: [-aspect {regular|bold|italic|boldItalic}=regular]"
"\n\t\t: [-font font=Times]"
"\n\t\t: [-2d]"
"\n\t\t: [-perspos {X Y Z}=0 0 0], where"
"\n\t\t: [-setLocation X Y [Z]]"
"\n\t\t: [-setRotation QX QY QZ QW]"
"\n\t\t: [-setScale [X Y Z] scale]"
+ "\n\t\t: [-inheritParentTrsf {on|off}]"
"\n\t\t: Object local transformation management:"
"\n\t\t: -reset reset transformation to identity"
"\n\t\t: -translate translate object"
"\n\t\t: -mirror applies mirror to local transformation"
"\n\t\t: -setLocation assign object location"
"\n\t\t: -setRotation assign object rotation (quaternion)"
- "\n\t\t: -setScale assign object scale factor",
+ "\n\t\t: -setScale assign object scale factor"
+ "\n\t\t: -inheritParentTrsf option to inherit parent"
+ "\n\t\t: transformation or not (ON by default)",
__FILE__, VSetLocation, group);
theCommands.Add ("vsetlocation",
"alias for vlocation",
__FILE__, VSetLocation, group);
-
+ theCommands.Add ("vchild",
+ "vchild parent [-add] [-remove] [-ignoreParentTrsf {0|1}] child1 [child2] [...]"
+ "\n\t\t: Command for testing low-level presentation connections."
+ "\n\t\t: vconnect command should be used instead.",
+ __FILE__, VChild, group);
+ theCommands.Add("vparent",
+ "vparent parent [-ignoreVisu]"
+ "\n\t\t: Command for testing object properties as parent in the hierarchy."
+ "\n\t\t: Arguments:"
+ "\n\t\t: -ignoreVisu do not propagate the visual state (display/erase/color) to children objects",
+ __FILE__, VParent, group);
theCommands.Add ("vcomputehlr",
"vcomputehlr shapeInput hlrResult [-algoType {algo|polyAlgo}=polyAlgo]"
"\n\t\t: [eyeX eyeY eyeZ dirX dirY dirZ upX upY upZ]"
theCommands.Add("vdrawparray",
"vdrawparray name TypeOfArray={points|segments|polylines|triangles"
"\n\t\t: |trianglefans|trianglestrips|quads|quadstrips|polygons}"
+ "\n\t\t: [-deinterleaved|-mutable]"
"\n\t\t: [vertex={'v' x y z [normal={'n' nx ny nz}] [color={'c' r g b}] [texel={'t' tx ty}]]"
"\n\t\t: [bound= {'b' nbVertices [bound_color={'c' r g b}]]"
"\n\t\t: [edge= {'e' vertexId]"
- "\n\t\t: [-shape shapeName]"
+ "\n\t\t: [-shape shapeName] [-patch]"
"\n\t\t: Commands create an Interactive Object for specified Primitive Array definition (Graphic3d_ArrayOfPrimitives)"
"\n\t\t: with the main purpose is covering various combinations by tests",
__FILE__,VDrawPArray,group);
"vpolygonoffset : [object [mode factor units]] - sets/gets polygon offset parameters for an object, without arguments prints the default values",
__FILE__, VPolygonOffset, group);
- theCommands.Add ("vshowfaceboundary",
- "vshowfaceboundary : ObjectName isOn (1/0) [R G B [LineWidth [LineStyle]]]"
- "- turns on/off drawing of face boundaries for ais object "
- "and defines boundary line style.",
- __FILE__, VShowFaceBoundary, group);
-
theCommands.Add ("vmarkerstest",
"vmarkerstest: name X Y Z [PointsOnSide=10] [MarkerType=0] [Scale=1.0] [FileName=ImageFile]\n",
__FILE__, VMarkersTest, group);
"\n\t\t: [-halign {left|center|right}=left]"
"\n\t\t: [-valign {top|center|bottom|topfirstline}=bottom}]"
"\n\t\t: [-height height=16]"
- "\n\t\t: [-aspect {regular|bold|italic|bolditalic}=regular]"
- "\n\t\t: [-font font=Courier]"
+ "\n\t\t: [-aspect {regular|bold|italic|boldItalic}=regular]"
+ "\n\t\t: [-font font=Courier] [-strict {strict|aliases|any}=any]"
"\n\t\t: [-composite {on|off}=off]"
"\n\t\t: [-plane NormX NormY NormZ DirX DirY DirZ]",
__FILE__, TextToBRep, group);
theCommands.Add ("vfont",
- "vfont [add pathToFont [fontName] [regular,bold,italic,bolditalic=undefined] [singleStroke]]"
- "\n\t\t: [find fontName [regular,bold,italic,bolditalic=undefined]]",
+ "vfont [-add pathToFont [fontName] [regular,bold,italic,boldItalic=undefined] [singleStroke]]"
+ "\n\t\t: [-strict {any|aliases|strict}] [-find fontName [regular,bold,italic,boldItalic=undefined]] [-verbose {on|off}]"
+ "\n\t\t: [-unicodeFallback {on|off}]",
__FILE__, VFont, group);
-
- theCommands.Add ("vsetedgetype",
- "vsetedgetype usage:\n"
- "vsetedgetype ShapeName [-force] [-type {solid, dash, dot}] [-color R G B] "
- "\n\t\t: Sets edges type and color for input shape",
- __FILE__, VSetEdgeType, group);
-
- theCommands.Add ("vunsetedgetype",
- "vunsetedgetype usage:\n"
- "vunsetedgetype ShapeName [-force]"
- "\n\t\t: Unsets edges type and color for input shape",
- __FILE__, VUnsetEdgeType, group);
theCommands.Add ("vvertexmode",
"vvertexmode [name | -set {isolated | all | inherited} [name1 name2 ...]]\n"
__FILE__, VVertexMode, group);
theCommands.Add ("vpointcloud",
- "vpointcloud name shape [-randColor] [-normals] [-noNormals]"
+ "vpointcloud name shape [-randColor] [-normals] [-noNormals] [-uv]"
"\n\t\t: Create an interactive object for arbitary set of points"
"\n\t\t: from triangulated shape."
"\n"
"vpointcloud name x y z r npts {surface|volume}\n"
- " ... [-randColor] [-normals] [-noNormals]"
+ " ... [-randColor] [-normals] [-noNormals] [-uv]"
"\n\t\t: Create arbitrary set of points (npts) randomly distributed"
"\n\t\t: on spheric surface or within spheric volume (x y z r)."
"\n\t\t:"