#include <ViewerTest.hxx>
#include <ViewerTest_CmdParser.hxx>
+#include <Draw.hxx>
#include <TopLoc_Location.hxx>
#include <TopTools_HArray1OfShape.hxx>
#include <TColStd_HArray1OfTransient.hxx>
#include <Prs3d_IsoAspect.hxx>
#include <Prs3d_PointAspect.hxx>
#include <Select3D_SensitiveWire.hxx>
+#include <Select3D_SensitivePrimitiveArray.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <StdSelect_BRepOwner.hxx>
#include <StdSelect_ViewerSelector3d.hxx>
#include <TCollection_AsciiString.hxx>
#include <Draw_PluginMacro.hxx>
-// avoid warnings on 'extern "C"' functions returning C++ classes
-#ifdef _MSC_VER
-#define _CRT_SECURE_NO_DEPRECATE
-#pragma warning(4:4190)
-#pragma warning (disable:4996)
-#endif
-
extern int ViewerMainLoop(Standard_Integer argc, const char** argv);
#include <Quantity_Color.hxx>
return Standard_False;
}
+//=======================================================================
+//function : GetSelectedShapes
+//purpose :
+//=======================================================================
+void ViewerTest::GetSelectedShapes (TopTools_ListOfShape& theSelectedShapes)
+{
+ for (GetAISContext()->InitSelected(); GetAISContext()->MoreSelected(); GetAISContext()->NextSelected())
+ {
+ TopoDS_Shape aShape = GetAISContext()->SelectedShape();
+ if (!aShape.IsNull())
+ {
+ theSelectedShapes.Append (aShape);
+ }
+ }
+}
+
+//=======================================================================
+//function : ParseLineType
+//purpose :
+//=======================================================================
+Standard_Boolean ViewerTest::ParseLineType (Standard_CString theArg,
+ Aspect_TypeOfLine& theType)
+{
+ TCollection_AsciiString aTypeStr (theArg);
+ aTypeStr.LowerCase();
+ if (aTypeStr == "empty")
+ {
+ theType = Aspect_TOL_EMPTY;
+ }
+ else if (aTypeStr == "solid")
+ {
+ theType = Aspect_TOL_SOLID;
+ }
+ else if (aTypeStr == "dot")
+ {
+ theType = Aspect_TOL_DOT;
+ }
+ else if (aTypeStr == "dash")
+ {
+ theType = Aspect_TOL_DASH;
+ }
+ else if (aTypeStr == "dotdash")
+ {
+ theType = Aspect_TOL_DOTDASH;
+ }
+ else
+ {
+ const int aTypeInt = Draw::Atoi (theArg);
+ if (aTypeInt < -1 || aTypeInt >= Aspect_TOL_USERDEFINED)
+ {
+ return Standard_False;
+ }
+ theType = (Aspect_TypeOfLine )aTypeInt;
+ }
+ return Standard_True;
+}
+
//=======================================================================
//function : GetTypeNames
//purpose :
Handle(AIS_InteractiveObject) anOldObj = Handle(AIS_InteractiveObject)::DownCast (aMap.Find2 (theName));
if (!anOldObj.IsNull())
{
- aCtx->Remove (anOldObj, Standard_True);
+ aCtx->Remove (anOldObj, theObject.IsNull() && theToUpdate);
}
aMap.UnBind2 (theName);
}
void ViewerTest::Clear()
{
if ( !a3DView().IsNull() ) {
- if (TheAISContext()->HasOpenedContext())
- TheAISContext()->CloseLocalContext();
ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName it(GetMapOfAIS());
while ( it.More() ) {
cout << "Remove " << it.Key2() << endl;
//purpose : Activate a selection mode, vertex, edge, wire ..., in a local
// Context
//==============================================================================
+Standard_DISABLE_DEPRECATION_WARNINGS
void ViewerTest::StandardModeActivation(const Standard_Integer mode )
{
Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
if(mode==0) {
if (TheAISContext()->HasOpenedContext())
+ {
aContext->CloseLocalContext();
+ }
} else {
if(!aContext->HasOpenedContext()) {
// Open a local Context in order to be able to select subshape from
// the selected shape if any or for all if there is no selection
if (!aContext->FirstSelectedObject().IsNull()){
- aContext->OpenLocalContext(Standard_False);
+ aContext->OpenLocalContext(Standard_False);
for(aContext->InitSelected();aContext->MoreSelected();aContext->NextSelected()){
aContext->Load( aContext->SelectedInteractive(),-1,Standard_True);
}
}
else
- aContext->OpenLocalContext();
+ {
+ aContext->OpenLocalContext();
+ }
}
const char *cmode="???";
}
if(theactivatedmodes.Contains(mode))
- { // Desactivate
- aContext->DeactivateStandardMode(AIS_Shape::SelectionType(mode));
- theactivatedmodes.Remove(mode);
- cout<<"Mode "<< cmode <<" OFF"<<endl;
- }
+ { // Desactivate
+ aContext->DeactivateStandardMode(AIS_Shape::SelectionType(mode));
+ theactivatedmodes.Remove(mode);
+ cout<<"Mode "<< cmode <<" OFF"<<endl;
+ }
else
- { // Activate
- aContext->ActivateStandardMode(AIS_Shape::SelectionType(mode));
- theactivatedmodes.Add(mode);
- cout<<"Mode "<< cmode << " ON" << endl;
- }
+ { // Activate
+ aContext->ActivateStandardMode(AIS_Shape::SelectionType(mode));
+ theactivatedmodes.Add(mode);
+ cout<<"Mode "<< cmode << " ON" << endl;
+ }
}
}
+Standard_ENABLE_DEPRECATION_WARNINGS
//==============================================================================
//function : CopyIsoAspect
(const Handle(Prs3d_IsoAspect) &theIsoAspect,
const Standard_Integer theNbIsos)
{
- Quantity_Color aColor;
- Aspect_TypeOfLine aType;
- Standard_Real aWidth;
-
- theIsoAspect->Aspect()->Values(aColor, aType, aWidth);
+ Quantity_Color aColor = theIsoAspect->Aspect()->Color();
+ Aspect_TypeOfLine aType = theIsoAspect->Aspect()->Type();
+ Standard_Real aWidth = theIsoAspect->Aspect()->Width();
Handle(Prs3d_IsoAspect) aResult =
new Prs3d_IsoAspect(aColor, aType, aWidth, theNbIsos);
return 0;
}
-//==============================================================================
-//function : VSelPrecision
-//purpose : To set the selection tolerance value
-//Draw arg : Selection tolerance value (real value determining the width and
-// height of selecting frustum bases). Without arguments the function
-// just prints current tolerance.
-//==============================================================================
-static int VSelPrecision(Draw_Interpretor& di, Standard_Integer argc, const char** argv)
-{
- if( argc > 2 )
- {
- di << "Wrong parameters! Must be: " << argv[0] << " [-unset] [tolerance]\n";
- return 1;
- }
-
- Handle(AIS_InteractiveContext) aContext = ViewerTest::GetAISContext();
- if( aContext.IsNull() )
- return 1;
-
- if( argc == 1 )
- {
- Standard_Real aPixelTolerance = aContext->PixelTolerance();
- di << "Pixel tolerance : " << aPixelTolerance << "\n";
- }
- else if (argc == 2)
- {
- TCollection_AsciiString anArg = TCollection_AsciiString (argv[1]);
- anArg.LowerCase();
- if (anArg == "-unset")
- {
- aContext->SetPixelTolerance (-1);
- }
- else
- {
- aContext->SetPixelTolerance (anArg.IntegerValue());
- }
- }
-
- return 0;
-}
-
//! Auxiliary enumeration
enum ViewerTest_StereoPair
{
Standard_Integer anArgIter = 1;
Standard_CString aFilePath = theArgVec[anArgIter++];
- Graphic3d_BufferType aBufferType = Graphic3d_BT_RGB;
- V3d_StereoDumpOptions aStereoOpts = V3d_SDO_MONO;
ViewerTest_StereoPair aStereoPair = ViewerTest_SP_Single;
- Standard_Integer aWidth = 0;
- Standard_Integer aHeight = 0;
+ V3d_ImageDumpOptions aParams;
+ aParams.BufferType = Graphic3d_BT_RGB;
+ aParams.StereoOptions = V3d_SDO_MONO;
for (; anArgIter < theArgNb; ++anArgIter)
{
TCollection_AsciiString anArg (theArgVec[anArgIter]);
aBufArg.LowerCase();
if (aBufArg == "rgba")
{
- aBufferType = Graphic3d_BT_RGBA;
+ aParams.BufferType = Graphic3d_BT_RGBA;
}
else if (aBufArg == "rgb")
{
- aBufferType = Graphic3d_BT_RGB;
+ aParams.BufferType = Graphic3d_BT_RGB;
}
else if (aBufArg == "depth")
{
- aBufferType = Graphic3d_BT_Depth;
+ aParams.BufferType = Graphic3d_BT_Depth;
}
else
{
if (aStereoArg == "l"
|| aStereoArg == "left")
{
- aStereoOpts = V3d_SDO_LEFT_EYE;
+ aParams.StereoOptions = V3d_SDO_LEFT_EYE;
}
else if (aStereoArg == "r"
|| aStereoArg == "right")
{
- aStereoOpts = V3d_SDO_RIGHT_EYE;
+ aParams.StereoOptions = V3d_SDO_RIGHT_EYE;
}
else if (aStereoArg == "mono")
{
- aStereoOpts = V3d_SDO_MONO;
+ aParams.StereoOptions = V3d_SDO_MONO;
}
else if (aStereoArg == "blended"
|| aStereoArg == "blend"
|| aStereoArg == "stereo")
{
- aStereoOpts = V3d_SDO_BLENDED;
+ aParams.StereoOptions = V3d_SDO_BLENDED;
}
else if (aStereoArg == "sbs"
|| aStereoArg == "sidebyside")
else if (anArg == "-rgba"
|| anArg == "rgba")
{
- aBufferType = Graphic3d_BT_RGBA;
+ aParams.BufferType = Graphic3d_BT_RGBA;
}
else if (anArg == "-rgb"
|| anArg == "rgb")
{
- aBufferType = Graphic3d_BT_RGB;
+ aParams.BufferType = Graphic3d_BT_RGB;
}
else if (anArg == "-depth"
|| anArg == "depth")
{
- aBufferType = Graphic3d_BT_Depth;
+ aParams.BufferType = Graphic3d_BT_Depth;
}
-
else if (anArg == "-width"
|| anArg == "width"
|| anArg == "sizex")
{
- if (aWidth != 0)
+ if (aParams.Width != 0)
{
std::cout << "Error: wrong syntax at " << theArgVec[anArgIter] << "\n";
return 1;
std::cout << "Error: integer value is expected right after 'width'\n";
return 1;
}
- aWidth = Draw::Atoi (theArgVec[anArgIter]);
+ aParams.Width = Draw::Atoi (theArgVec[anArgIter]);
}
else if (anArg == "-height"
|| anArg == "height"
|| anArg == "-sizey")
{
- if (aHeight != 0)
+ if (aParams.Height != 0)
{
std::cout << "Error: wrong syntax at " << theArgVec[anArgIter] << "\n";
return 1;
std::cout << "Error: integer value is expected right after 'height'\n";
return 1;
}
- aHeight = Draw::Atoi (theArgVec[anArgIter]);
+ aParams.Height = Draw::Atoi (theArgVec[anArgIter]);
+ }
+ else if (anArg == "-tile"
+ || anArg == "-tilesize")
+ {
+ if (++anArgIter >= theArgNb)
+ {
+ std::cout << "Error: integer value is expected right after 'tileSize'\n";
+ return 1;
+ }
+ aParams.TileSize = Draw::Atoi (theArgVec[anArgIter]);
}
else
{
return 1;
}
}
- if ((aWidth <= 0 && aHeight > 0)
- || (aWidth > 0 && aHeight <= 0))
+ if ((aParams.Width <= 0 && aParams.Height > 0)
+ || (aParams.Width > 0 && aParams.Height <= 0))
{
- std::cout << "Error: dimensions " << aWidth << "x" << aHeight << " are incorrect\n";
+ std::cout << "Error: dimensions " << aParams.Width << "x" << aParams.Height << " are incorrect\n";
return 1;
}
return 1;
}
- if (aWidth <= 0 || aHeight <= 0)
+ if (aParams.Width <= 0 || aParams.Height <= 0)
{
- aView->Window()->Size (aWidth, aHeight);
+ aView->Window()->Size (aParams.Width, aParams.Height);
}
Image_AlienPixMap aPixMap;
-
- bool isBigEndian = Image_PixMap::IsBigEndianHost();
Image_PixMap::ImgFormat aFormat = Image_PixMap::ImgUNKNOWN;
- switch (aBufferType)
+ switch (aParams.BufferType)
{
- case Graphic3d_BT_RGB: aFormat = isBigEndian ? Image_PixMap::ImgRGB : Image_PixMap::ImgBGR; break;
- case Graphic3d_BT_RGBA: aFormat = isBigEndian ? Image_PixMap::ImgRGBA : Image_PixMap::ImgBGRA; break;
+ case Graphic3d_BT_RGB: aFormat = Image_PixMap::ImgRGB; break;
+ case Graphic3d_BT_RGBA: aFormat = Image_PixMap::ImgRGBA; break;
case Graphic3d_BT_Depth: aFormat = Image_PixMap::ImgGrayF; break;
}
{
case ViewerTest_SP_Single:
{
- if (!aView->ToPixMap (aPixMap, aWidth, aHeight, aBufferType, Standard_True, aStereoOpts))
+ if (!aView->ToPixMap (aPixMap, aParams))
{
theDI << "Fail: view dump failed!\n";
return 0;
}
- else if (aPixMap.SizeX() != Standard_Size(aWidth)
- || aPixMap.SizeY() != Standard_Size(aHeight))
+ else if (aPixMap.SizeX() != Standard_Size(aParams.Width)
+ || aPixMap.SizeY() != Standard_Size(aParams.Height))
{
theDI << "Fail: dumped dimensions " << (Standard_Integer )aPixMap.SizeX() << "x" << (Standard_Integer )aPixMap.SizeY()
- << " are lesser than requested " << aWidth << "x" << aHeight << "\n";
+ << " are lesser than requested " << aParams.Width << "x" << aParams.Height << "\n";
}
break;
}
case ViewerTest_SP_SideBySide:
{
- if (!aPixMap.InitZero (aFormat, aWidth * 2, aHeight))
+ if (!aPixMap.InitZero (aFormat, aParams.Width * 2, aParams.Height))
{
theDI << "Fail: not enough memory for image allocation!\n";
return 0;
Image_PixMap aPixMapL, aPixMapR;
aPixMapL.InitWrapper (aPixMap.Format(), aPixMap.ChangeData(),
- aWidth, aHeight, aPixMap.SizeRowBytes());
- aPixMapR.InitWrapper (aPixMap.Format(), aPixMap.ChangeData() + aPixMap.SizePixelBytes() * aWidth,
- aWidth, aHeight, aPixMap.SizeRowBytes());
- if (!aView->ToPixMap (aPixMapL, aWidth, aHeight, aBufferType, Standard_True, V3d_SDO_LEFT_EYE)
- || !aView->ToPixMap (aPixMapR, aWidth, aHeight, aBufferType, Standard_True, V3d_SDO_RIGHT_EYE)
- )
+ aParams.Width, aParams.Height, aPixMap.SizeRowBytes());
+ aPixMapR.InitWrapper (aPixMap.Format(), aPixMap.ChangeData() + aPixMap.SizePixelBytes() * aParams.Width,
+ aParams.Width, aParams.Height, aPixMap.SizeRowBytes());
+
+ aParams.StereoOptions = V3d_SDO_LEFT_EYE;
+ Standard_Boolean isOk = aView->ToPixMap (aPixMapL, aParams);
+ aParams.StereoOptions = V3d_SDO_RIGHT_EYE;
+ isOk = isOk && aView->ToPixMap (aPixMapR, aParams);
+ if (!isOk)
{
theDI << "Fail: view dump failed!\n";
return 0;
}
case ViewerTest_SP_OverUnder:
{
- if (!aPixMap.InitZero (aFormat, aWidth, aHeight * 2))
+ if (!aPixMap.InitZero (aFormat, aParams.Width, aParams.Height * 2))
{
theDI << "Fail: not enough memory for image allocation!\n";
return 0;
}
Image_PixMap aPixMapL, aPixMapR;
- aPixMapL.InitWrapper (aFormat, aPixMap.ChangeData(),
- aWidth, aHeight, aPixMap.SizeRowBytes());
- aPixMapR.InitWrapper (aFormat, aPixMap.ChangeData() + aPixMap.SizeRowBytes() * aHeight,
- aWidth, aHeight, aPixMap.SizeRowBytes());
- if (!aView->ToPixMap (aPixMapL, aWidth, aHeight, aBufferType, Standard_True, V3d_SDO_LEFT_EYE)
- || !aView->ToPixMap (aPixMapR, aWidth, aHeight, aBufferType, Standard_True, V3d_SDO_RIGHT_EYE))
+ aPixMapL.InitWrapper (aPixMap.Format(), aPixMap.ChangeData(),
+ aParams.Width, aParams.Height, aPixMap.SizeRowBytes());
+ aPixMapR.InitWrapper (aPixMap.Format(), aPixMap.ChangeData() + aPixMap.SizeRowBytes() * aParams.Height,
+ aParams.Width, aParams.Height, aPixMap.SizeRowBytes());
+
+ aParams.StereoOptions = V3d_SDO_LEFT_EYE;
+ Standard_Boolean isOk = aView->ToPixMap (aPixMapL, aParams);
+ aParams.StereoOptions = V3d_SDO_RIGHT_EYE;
+ isOk = isOk && aView->ToPixMap (aPixMapR, aParams);
+ if (!isOk)
{
theDI << "Fail: view dump failed!\n";
return 0;
return 0;
}
-//==============================================================================
-//function : Displays,Erase...
-//purpose :
-//Draw arg :
-//==============================================================================
-static int VwrTst_DispErase(const Handle(AIS_InteractiveObject)& IO,
- const Standard_Integer Mode,
- const Standard_Integer TypeOfOperation,
- const Standard_Boolean Upd)
+enum TypeOfDispOperation
{
- Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
+ TypeOfDispOperation_SetDispMode,
+ TypeOfDispOperation_UnsetDispMode
+};
- switch(TypeOfOperation){
- case 1:
- Ctx->Display(IO,Mode,Upd);
- break;
- case 2:{
- Ctx->Erase(IO,Upd);
- break;
- }
- case 3:{
- if(IO.IsNull())
- Ctx->SetDisplayMode((AIS_DisplayMode)Mode,Upd);
- else
- Ctx->SetDisplayMode(IO,Mode,Upd);
- break;
- }
- case 4:{
- if(IO.IsNull())
- Ctx->SetDisplayMode(0,Upd);
- else
- Ctx->UnsetDisplayMode(IO,Upd);
- break;
- }
+//! Displays,Erase...
+static void VwrTst_DispErase (const Handle(AIS_InteractiveObject)& thePrs,
+ const Standard_Integer theMode,
+ const TypeOfDispOperation theType,
+ const Standard_Boolean theToUpdate)
+{
+ Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
+ switch (theType)
+ {
+ case TypeOfDispOperation_SetDispMode:
+ {
+ if (!thePrs.IsNull())
+ {
+ aCtx->SetDisplayMode (thePrs, theMode, theToUpdate);
+ }
+ else
+ {
+ aCtx->SetDisplayMode ((AIS_DisplayMode )theMode, theToUpdate);
+ }
+ break;
+ }
+ case TypeOfDispOperation_UnsetDispMode:
+ {
+ if (!thePrs.IsNull())
+ {
+ aCtx->UnsetDisplayMode (thePrs, theToUpdate);
+ }
+ else
+ {
+ aCtx->SetDisplayMode (AIS_WireFrame, theToUpdate);
+ }
+ break;
+ }
}
- return 0;
}
//=======================================================================
//=======================================================================
static int VDispMode (Draw_Interpretor& , Standard_Integer argc, const char** argv)
{
-
- TCollection_AsciiString name;
- if(argc>3)
+ if (argc < 1
+ || argc > 3)
+ {
+ std::cout << "Syntax error: wrong number of arguments\n";
return 1;
- // display others presentations
- Standard_Integer TypeOfOperation = (strcasecmp(argv[0],"vdispmode")==0)? 1:
- (strcasecmp(argv[0],"verasemode")==0) ? 2 :
- (strcasecmp(argv[0],"vsetdispmode")==0) ? 3 :
- (strcasecmp(argv[0],"vunsetdispmode")==0) ? 4 : -1;
-
- Handle(AIS_InteractiveContext) Ctx = ViewerTest::GetAISContext();
+ }
- //unset displaymode.. comportement particulier...
- if(TypeOfOperation==4){
- if(argc==1){
- if(Ctx->NbSelected()==0){
- Handle(AIS_InteractiveObject) IO;
- VwrTst_DispErase(IO,-1,4,Standard_False);
+ TypeOfDispOperation aType = TCollection_AsciiString (argv[0]) == "vunsetdispmode"
+ ? TypeOfDispOperation_UnsetDispMode
+ : TypeOfDispOperation_SetDispMode;
+ Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
+ if (aType == TypeOfDispOperation_UnsetDispMode)
+ {
+ if (argc == 1)
+ {
+ if (aCtx->NbSelected() == 0)
+ {
+ VwrTst_DispErase (Handle(AIS_InteractiveObject)(), -1, TypeOfDispOperation_UnsetDispMode, Standard_False);
}
- else{
- for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
- VwrTst_DispErase(Ctx->SelectedInteractive(),-1,4,Standard_False);}
- Ctx->UpdateCurrentViewer();
+ else
+ {
+ for (aCtx->InitSelected(); aCtx->MoreSelected(); aCtx->NextSelected())
+ {
+ VwrTst_DispErase (aCtx->SelectedInteractive(), -1, TypeOfDispOperation_UnsetDispMode, Standard_False);
+ }
+ }
+ aCtx->UpdateCurrentViewer();
}
- else{
- Handle(AIS_InteractiveObject) IO;
- name = argv[1];
- if(GetMapOfAIS().IsBound2(name)){
- IO = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name));
- if (!IO.IsNull())
- VwrTst_DispErase(IO,-1,4,Standard_True);
+ else
+ {
+ TCollection_AsciiString aName = argv[1];
+ if (GetMapOfAIS().IsBound2 (aName))
+ {
+ Handle(AIS_InteractiveObject) aPrs = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2 (aName));
+ if (!aPrs.IsNull())
+ {
+ VwrTst_DispErase (aPrs, -1, TypeOfDispOperation_UnsetDispMode, Standard_True);
+ }
}
}
}
- else if(argc==2){
- Standard_Integer Dmode = Draw::Atoi(argv[1]);
- if(Ctx->NbSelected()==0 && TypeOfOperation==3){
- Handle(AIS_InteractiveObject) IO;
- VwrTst_DispErase(IO,Dmode,TypeOfOperation,Standard_True);
- }
- if(!Ctx->HasOpenedContext()){
- // set/unset display mode sur le Contexte...
- for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected()){
- VwrTst_DispErase(Ctx->SelectedInteractive(),Dmode,TypeOfOperation,Standard_False);
- }
- Ctx->UpdateCurrentViewer();
+ else if (argc == 2)
+ {
+ Standard_Integer aDispMode = Draw::Atoi (argv[1]);
+ if (aCtx->NbSelected() == 0
+ && aType == TypeOfDispOperation_SetDispMode)
+ {
+ VwrTst_DispErase (Handle(AIS_InteractiveObject)(), aDispMode, TypeOfDispOperation_SetDispMode, Standard_True);
}
- else{
- for(Ctx->InitSelected();Ctx->MoreSelected();Ctx->NextSelected())
- Ctx->Display(Ctx->SelectedInteractive(),Dmode);
+ for (aCtx->InitSelected(); aCtx->MoreSelected(); aCtx->NextSelected())
+ {
+ VwrTst_DispErase (aCtx->SelectedInteractive(), aDispMode, aType, Standard_False);
}
+ aCtx->UpdateCurrentViewer();
}
- else{
- Handle(AIS_InteractiveObject) IO;
- name = argv[1];
- if(GetMapOfAIS().IsBound2(name))
- IO = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2(name));
- if (!IO.IsNull())
- VwrTst_DispErase(IO,Draw::Atoi(argv[2]),TypeOfOperation,Standard_True);
+ else
+ {
+ Handle(AIS_InteractiveObject) aPrs;
+ TCollection_AsciiString aName (argv[1]);
+ if (GetMapOfAIS().IsBound2 (aName))
+ {
+ aPrs = Handle(AIS_InteractiveObject)::DownCast(GetMapOfAIS().Find2 (aName));
+ }
+ if (!aPrs.IsNull())
+ {
+ VwrTst_DispErase (aPrs, Draw::Atoi(argv[2]), aType, Standard_True);
+ }
}
return 0;
}
return 1;
}
- if (aCtx->HasOpenedContext())
- {
- aCtx->CloseLocalContext();
- }
for (ViewTest_PrsIter anIter (aName); anIter.More(); anIter.Next())
{
const Handle(AIS_InteractiveObject)& anIO = anIter.Current();
Standard_Integer SelectionMode;
Standard_Integer Sensitivity;
+ Standard_Integer ToSetHatch;
+ Standard_Integer StdHatchStyle;
+ TCollection_AsciiString PathToHatchPattern;
+
//! Empty constructor
ViewerTest_AspectsChangeSet()
: ToSetVisibility (0),
MaxParamValue (500000),
ToSetSensitivity (0),
SelectionMode (-1),
- Sensitivity (-1) {}
+ Sensitivity (-1),
+ ToSetHatch (0),
+ StdHatchStyle (-1)
+ {}
//! @return true if no changes have been requested
Standard_Boolean IsEmpty() const
&& ToSetFreeBoundaryColor == 0
&& ToSetFreeBoundaryWidth == 0
&& ToSetMaxParamValue == 0
- && ToSetSensitivity == 0;
+ && ToSetSensitivity == 0
+ && ToSetHatch == 0;
}
//! @return true if properties are valid
std::cout << "Error: sensitivity parameter value should be positive (specified " << Sensitivity << ")\n";
isOk = Standard_False;
}
+ if (ToSetHatch == 1 && StdHatchStyle < 0 && PathToHatchPattern == "")
+ {
+ std::cout << "Error: hatch style must be specified\n";
+ isOk = Standard_False;
+ }
return isOk;
}
std::cout << "Error: wrong syntax at " << anArg << "\n";
return 1;
}
-
- TCollection_AsciiString aValue (theArgVec[anArgIter]);
- aValue.LowerCase();
-
- if (aValue.IsEqual ("solid"))
- {
- aChangeSet->TypeOfLine = Aspect_TOL_SOLID;
- }
- else if (aValue.IsEqual ("dot"))
- {
- aChangeSet->TypeOfLine = Aspect_TOL_DOT;
- }
- else if (aValue.IsEqual ("dash"))
- {
- aChangeSet->TypeOfLine = Aspect_TOL_DASH;
- }
- else if (aValue.IsEqual ("dotdash"))
- {
- aChangeSet->TypeOfLine = Aspect_TOL_DOTDASH;
- }
- else
+ if (!ViewerTest::ParseLineType (theArgVec[anArgIter], aChangeSet->TypeOfLine))
{
std::cout << "Error: wrong syntax at " << anArg << "\n";
return 1;
aChangeSet->FreeBoundaryColor = DEFAULT_FREEBOUNDARY_COLOR;
aChangeSet->ToSetFreeBoundaryWidth = -1;
aChangeSet->FreeBoundaryWidth = 1.0;
+ aChangeSet->ToSetHatch = -1;
+ aChangeSet->StdHatchStyle = -1;
+ aChangeSet->PathToHatchPattern.Clear();
}
else if (anArg == "-isoontriangulation"
|| anArg == "-isoontriang")
aChangeSet->SelectionMode = Draw::Atoi (theArgVec[++anArgIter]);
aChangeSet->Sensitivity = Draw::Atoi (theArgVec[++anArgIter]);
}
+ else if (anArg == "-sethatch")
+ {
+ if (isDefaults)
+ {
+ std::cout << "Error: wrong syntax. -setHatch can not be used together with -defaults call!\n";
+ return 1;
+ }
+
+ if (aNames.IsEmpty())
+ {
+ std::cout << "Error: object should be specified explicitly when -setHatch is used!\n";
+ return 1;
+ }
+
+ aChangeSet->ToSetHatch = 1;
+ TCollection_AsciiString anArgHatch (theArgVec[++anArgIter]);
+ if (anArgHatch.Length() <= 2)
+ {
+ aChangeSet->StdHatchStyle = Draw::Atoi (anArgHatch.ToCString());
+ }
+ else
+ {
+ aChangeSet->PathToHatchPattern = anArgHatch;
+ }
+ }
else
{
std::cout << "Error: wrong syntax at " << anArg << "\n";
isFirst = Standard_False;
}
- if (aCtx->HasOpenedContext())
- {
- aCtx->CloseLocalContext();
- }
-
// special case for -defaults parameter.
// all changed values will be set to DefaultDrawer.
if (isDefaults)
if (aColoredPrs.IsNull())
{
aColoredPrs = new AIS_ColoredShape (aShapePrs);
+ if (aShapePrs->HasDisplayMode())
+ {
+ aColoredPrs->SetDisplayMode (aShapePrs->DisplayMode());
+ }
+ aColoredPrs->SetLocalTransformation (aShapePrs->LocalTransformation());
aCtx->Remove (aShapePrs, Standard_False);
GetMapOfAIS().UnBind2 (aName);
GetMapOfAIS().Bind (aColoredPrs, aName);
{
aDrawer->SetMaximalParameterValue (aChangeSet->MaxParamValue);
}
+ if (aChangeSet->ToSetHatch != 0)
+ {
+ if (!aDrawer->HasOwnShadingAspect())
+ {
+ aDrawer->SetShadingAspect (new Prs3d_ShadingAspect());
+ *aDrawer->ShadingAspect()->Aspect() = *aCtx->DefaultDrawer()->ShadingAspect()->Aspect();
+ }
+
+ Handle(Graphic3d_AspectFillArea3d) anAsp = aDrawer->ShadingAspect()->Aspect();
+ if (aChangeSet->ToSetHatch == -1)
+ {
+ anAsp->SetInteriorStyle (Aspect_IS_SOLID);
+ }
+ else
+ {
+ anAsp->SetInteriorStyle (Aspect_IS_HATCH);
+ if (!aChangeSet->PathToHatchPattern.IsEmpty())
+ {
+ Handle(Image_AlienPixMap) anImage = new Image_AlienPixMap();
+ if (anImage->Load (TCollection_AsciiString (aChangeSet->PathToHatchPattern.ToCString())))
+ {
+ anAsp->SetHatchStyle (new Graphic3d_HatchStyle (anImage));
+ }
+ else
+ {
+ std::cout << "Error: cannot load the following image: " << aChangeSet->PathToHatchPattern << std::endl;
+ return 1;
+ }
+ }
+ else if (aChangeSet->StdHatchStyle != -1)
+ {
+ anAsp->SetHatchStyle (new Graphic3d_HatchStyle ((Aspect_HatchStyle)aChangeSet->StdHatchStyle));
+ }
+ }
+ toRedisplay = Standard_True;
+ }
}
for (aChangesIter.Next(); aChangesIter.More(); aChangesIter.Next())
return 1;
}
+ Standard_DISABLE_DEPRECATION_WARNINGS
if (aCtx->HasOpenedContext())
{
aCtx->CloseLocalContext();
}
+ Standard_ENABLE_DEPRECATION_WARNINGS
Standard_Integer anArgIter = 1;
for (; anArgIter < theArgNb; ++anArgIter)
return 1;
}
+ Standard_DISABLE_DEPRECATION_WARNINGS
if (toRemoveLocal && !aCtx->HasOpenedContext())
{
std::cerr << "Error: local selection context is not open.\n";
{
aCtx->CloseAllContexts (Standard_False);
}
+ Standard_ENABLE_DEPRECATION_WARNINGS
NCollection_List<TCollection_AsciiString> anIONameList;
if (toRemoveAll)
// Close local context if it is empty
TColStd_MapOfTransient aLocalIO;
+ Standard_DISABLE_DEPRECATION_WARNINGS
if (aCtx->HasOpenedContext()
&& !aCtx->LocalContext()->DisplayedObjects (aLocalIO))
{
aCtx->CloseAllContexts (Standard_False);
}
+ Standard_ENABLE_DEPRECATION_WARNINGS
return 0;
}
return 1;
}
+ Standard_DISABLE_DEPRECATION_WARNINGS
if (toEraseLocal && !aCtx->HasOpenedContext())
{
std::cerr << "Error: local selection context is not open.\n";
{
aCtx->CloseAllContexts (Standard_False);
}
+ Standard_ENABLE_DEPRECATION_WARNINGS
if (!aNamesOfEraseIO.IsEmpty())
{
else if (!toEraseAll && aCtx->NbSelected() > 0)
{
// Erase selected objects
+ const Standard_Boolean aHasOpenedContext = aCtx->HasOpenedContext();
for (ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName anIter (GetMapOfAIS());
anIter.More(); anIter.Next())
{
{
aCtx->SetViewAffinity (anIO, aView, Standard_False);
}
- else
+ else if (aHasOpenedContext)
{
aCtx->Erase (anIO, Standard_False);
}
}
}
+
+ if (!toEraseInView)
+ {
+ aCtx->EraseSelected (Standard_False);
+ }
}
else
{
return 1;
}
+ Standard_DISABLE_DEPRECATION_WARNINGS
if (toDisplayLocal && !aCtx->HasOpenedContext())
{
std::cerr << "Error: local selection context is not open.\n";
{
aCtx->CloseLocalContext (Standard_False);
}
+ Standard_ENABLE_DEPRECATION_WARNINGS
for (ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName anIter (GetMapOfAIS());
anIter.More(); anIter.Next())
return 0;
}
-//! Auxiliary method to find presentation
-inline Handle(PrsMgr_Presentation) findPresentation (const Handle(AIS_InteractiveContext)& theCtx,
- const Handle(AIS_InteractiveObject)& theIO,
- const Standard_Integer theMode)
+//! Auxiliary method to check if presentation exists
+inline Standard_Integer checkMode (const Handle(AIS_InteractiveContext)& theCtx,
+ const Handle(AIS_InteractiveObject)& theIO,
+ const Standard_Integer theMode)
{
- if (theIO.IsNull())
+ if (theIO.IsNull() || theCtx.IsNull())
{
- return Handle(PrsMgr_Presentation)();
+ return -1;
}
if (theMode != -1)
{
if (theCtx->MainPrsMgr()->HasPresentation (theIO, theMode))
{
- return theCtx->MainPrsMgr()->Presentation (theIO, theMode);
+ return theMode;
}
}
else if (theCtx->MainPrsMgr()->HasPresentation (theIO, theIO->DisplayMode()))
{
- return theCtx->MainPrsMgr()->Presentation (theIO, theIO->DisplayMode());
+ return theIO->DisplayMode();
}
else if (theCtx->MainPrsMgr()->HasPresentation (theIO, theCtx->DisplayMode()))
{
- return theCtx->MainPrsMgr()->Presentation (theIO, theCtx->DisplayMode());
+ return theCtx->DisplayMode();
}
- return Handle(PrsMgr_Presentation)();
+
+ return -1;
}
enum ViewerTest_BndAction
};
//! Auxiliary method to print bounding box of presentation
-inline void bndPresentation (Draw_Interpretor& theDI,
- const Handle(PrsMgr_Presentation)& thePrs,
- const TCollection_AsciiString& theName,
- const ViewerTest_BndAction theAction)
+inline void bndPresentation (Draw_Interpretor& theDI,
+ const Handle(PrsMgr_PresentationManager)& theMgr,
+ const Handle(AIS_InteractiveObject)& theObj,
+ const Standard_Integer theDispMode,
+ const TCollection_AsciiString& theName,
+ const ViewerTest_BndAction theAction,
+ const Handle(Prs3d_Drawer)& theStyle)
{
switch (theAction)
{
case BndAction_Hide:
{
- thePrs->Presentation()->GraphicUnHighlight();
+ theMgr->Unhighlight (theObj);
break;
}
case BndAction_Show:
{
- Handle(Graphic3d_Structure) aPrs (thePrs->Presentation());
- aPrs->CStructure()->HighlightColor.r = 0.988235f;
- aPrs->CStructure()->HighlightColor.g = 0.988235f;
- aPrs->CStructure()->HighlightColor.b = 0.988235f;
- aPrs->CStructure()->HighlightWithBndBox (aPrs, Standard_True);
+ theMgr->Color (theObj, theStyle, theDispMode);
break;
}
case BndAction_Print:
{
- Bnd_Box aBox = thePrs->Presentation()->MinMaxValues();
+ Bnd_Box aBox;
+ for (PrsMgr_Presentations::Iterator aPrsIter (theObj->Presentations()); aPrsIter.More(); aPrsIter.Next())
+ {
+ if (aPrsIter.Value().Mode() != theDispMode)
+ continue;
+
+ aBox = aPrsIter.Value().Presentation()->Presentation()->MinMaxValues();
+ }
gp_Pnt aMin = aBox.CornerMin();
gp_Pnt aMax = aBox.CornerMax();
theDI << theName << "\n"
ViewerTest_BndAction anAction = BndAction_Show;
Standard_Integer aMode = -1;
+ Handle(Prs3d_Drawer) aStyle;
+
Standard_Integer anArgIter = 1;
for (; anArgIter < theArgNb; ++anArgIter)
{
}
}
+ if (anAction == BndAction_Show)
+ {
+ aStyle = new Prs3d_Drawer();
+ aStyle->SetMethod (Aspect_TOHM_BOUNDBOX);
+ aStyle->SetColor (Quantity_NOC_GRAY99);
+ }
+
+ Standard_Integer aHighlightedMode = -1;
if (anArgIter < theArgNb)
{
// has a list of names
}
Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast (GetMapOfAIS().Find2 (aName));
- Handle(PrsMgr_Presentation) aPrs = findPresentation (aCtx, anIO, aMode);
- if (aPrs.IsNull())
+ aHighlightedMode = checkMode (aCtx, anIO, aMode);
+ if (aHighlightedMode == -1)
{
- std::cout << "Error: presentation " << aName << " does not exist\n";
+ std::cout << "Error: object " << aName << " has no presentation with mode " << aMode << std::endl;
return 1;
}
- bndPresentation (theDI, aPrs, aName, anAction);
+ bndPresentation (theDI, aCtx->MainPrsMgr(), anIO, aHighlightedMode, aName, anAction, aStyle);
}
}
else if (aCtx->NbSelected() > 0)
for (aCtx->InitSelected(); aCtx->MoreSelected(); aCtx->NextSelected())
{
Handle(AIS_InteractiveObject) anIO = aCtx->SelectedInteractive();
- Handle(PrsMgr_Presentation) aPrs = findPresentation (aCtx, anIO, aMode);
- if (!aPrs.IsNull())
+ aHighlightedMode = checkMode (aCtx, anIO, aMode);
+ if (aHighlightedMode != -1)
{
- bndPresentation (theDI, aPrs, GetMapOfAIS().IsBound1 (anIO) ? GetMapOfAIS().Find1 (anIO) : "", anAction);
+ bndPresentation (theDI, aCtx->MainPrsMgr(), anIO, aHighlightedMode,
+ GetMapOfAIS().IsBound1 (anIO) ? GetMapOfAIS().Find1 (anIO) : "", anAction, aStyle);
}
}
}
anIter.More(); anIter.Next())
{
Handle(AIS_InteractiveObject) anIO = Handle(AIS_InteractiveObject)::DownCast (anIter.Key1());
- Handle(PrsMgr_Presentation) aPrs = findPresentation (aCtx, anIO, aMode);
- if (!aPrs.IsNull())
+ aHighlightedMode = checkMode (aCtx, anIO, aMode);
+ if (aHighlightedMode != -1)
{
- bndPresentation (theDI, aPrs, anIter.Key2(), anAction);
+ bndPresentation (theDI, aCtx->MainPrsMgr(), anIO, aHighlightedMode, anIter.Key2(), anAction, aStyle);
}
}
}
Standard_Integer aPreviousMode = 0;
- ViewerTest::CurrentView()->SetSurfaceDetail (V3d_TEX_ALL);
-
TCollection_AsciiString aShapeName (theArgv[1]);
Handle(AIS_InteractiveObject) anIO;
}
else
{
- anAISContext->Remove (anIO, Standard_False);
aTexturedIO = new AIS_TexturedShape (DBRep::Get (theArgv[1]));
+
+ if (anIO->HasTransformation())
+ {
+ const gp_Trsf& aLocalTrsf = anIO->LocalTransformation();
+ aTexturedIO->SetLocalTransformation (aLocalTrsf);
+ }
+
+ anAISContext->Remove (anIO, Standard_False);
GetMapOfAIS().UnBind1 (anIO);
GetMapOfAIS().UnBind2 (aShapeName);
GetMapOfAIS().Bind (aTexturedIO, aShapeName);
//! Auxiliary method to parse transformation persistence flags
inline Standard_Boolean parseTrsfPersFlag (const TCollection_AsciiString& theFlagString,
- Standard_Integer& theFlags)
+ Graphic3d_TransModeFlags& theFlags)
{
- if (theFlagString == "pan")
- {
- theFlags |= Graphic3d_TMF_PanPers;
- }
- else if (theFlagString == "zoom")
+ if (theFlagString == "zoom")
{
- theFlags |= Graphic3d_TMF_ZoomPers;
+ theFlags = Graphic3d_TMF_ZoomPers;
}
else if (theFlagString == "rotate")
{
- theFlags |= Graphic3d_TMF_RotatePers;
+ theFlags = Graphic3d_TMF_RotatePers;
}
- else if (theFlagString == "trihedron")
+ else if (theFlagString == "zoomrotate")
{
- theFlags = Graphic3d_TMF_TriedronPers;
+ theFlags = Graphic3d_TMF_ZoomRotatePers;
}
- else if (theFlagString == "full")
+ else if (theFlagString == "trihedron"
+ || theFlagString == "triedron")
{
- theFlags = Graphic3d_TMF_FullPers;
+ theFlags = Graphic3d_TMF_TriedronPers;
}
else if (theFlagString == "none")
{
return Standard_True;
}
+//! Auxiliary method to parse transformation persistence flags
+inline Standard_Boolean parseTrsfPersCorner (const TCollection_AsciiString& theString,
+ Aspect_TypeOfTriedronPosition& theCorner)
+{
+ TCollection_AsciiString aString (theString);
+ aString.LowerCase();
+ if (aString == "center")
+ {
+ theCorner = Aspect_TOTP_CENTER;
+ }
+ else if (aString == "top"
+ || aString == "upper")
+ {
+ theCorner = Aspect_TOTP_TOP;
+ }
+ else if (aString == "bottom"
+ || aString == "lower")
+ {
+ theCorner = Aspect_TOTP_BOTTOM;
+ }
+ else if (aString == "left")
+ {
+ theCorner = Aspect_TOTP_LEFT;
+ }
+ else if (aString == "right")
+ {
+ theCorner = Aspect_TOTP_RIGHT;
+ }
+ else if (aString == "topleft"
+ || aString == "leftupper"
+ || aString == "upperleft")
+ {
+ theCorner = Aspect_TOTP_LEFT_UPPER;
+ }
+ else if (aString == "bottomleft"
+ || aString == "leftlower"
+ || aString == "lowerleft")
+ {
+ theCorner = Aspect_TOTP_LEFT_LOWER;
+ }
+ else if (aString == "topright"
+ || aString == "rightupper"
+ || aString == "upperright")
+ {
+ theCorner = Aspect_TOTP_RIGHT_UPPER;
+ }
+ else if (aString == "bottomright"
+ || aString == "lowerright"
+ || aString == "rightlower")
+ {
+ theCorner = Aspect_TOTP_RIGHT_LOWER;
+ }
+ else
+ {
+ return Standard_False;
+ }
+
+ return Standard_True;
+}
+
//==============================================================================
//function : VDisplay2
//author : ege
Standard_Integer anObjDispMode = -2;
Standard_Integer anObjHighMode = -2;
Standard_Boolean toSetTrsfPers = Standard_False;
- Graphic3d_TransModeFlags aTrsfPersFlags = Graphic3d_TMF_None;
- gp_Pnt aTPPosition;
+ Handle(Graphic3d_TransformPers) aTrsfPers;
TColStd_SequenceOfAsciiString aNamesOfDisplayIO;
AIS_DisplayStatus aDispStatus = AIS_DS_None;
Standard_Integer toDisplayInView = Standard_False;
else if (aNameCase == "-3d")
{
toSetTrsfPers = Standard_True;
- aTrsfPersFlags = Graphic3d_TMF_None;
- }
- else if (aNameCase == "-2d")
- {
- toSetTrsfPers = Standard_True;
- aTrsfPersFlags = Graphic3d_TMF_2d;
+ aTrsfPers.Nullify();
}
- else if (aNameCase == "-2dtopdown")
+ else if (aNameCase == "-2d"
+ || aNameCase == "-trihedron"
+ || aNameCase == "-triedron")
{
toSetTrsfPers = Standard_True;
- aTrsfPersFlags = Graphic3d_TMF_2d | Graphic3d_TMF_2d_IsTopDown;
+ aTrsfPers = new Graphic3d_TransformPers (aNameCase == "-2d" ? Graphic3d_TMF_2d : Graphic3d_TMF_TriedronPers, Aspect_TOTP_LEFT_LOWER);
+
+ if (anArgIter + 1 < theArgNb)
+ {
+ Aspect_TypeOfTriedronPosition aCorner = Aspect_TOTP_CENTER;
+ if (parseTrsfPersCorner (theArgVec[anArgIter + 1], aCorner))
+ {
+ ++anArgIter;
+ aTrsfPers->SetCorner2d (aCorner);
+
+ if (anArgIter + 2 < theArgNb)
+ {
+ TCollection_AsciiString anX (theArgVec[anArgIter + 1]);
+ TCollection_AsciiString anY (theArgVec[anArgIter + 2]);
+ if (anX.IsIntegerValue()
+ && anY.IsIntegerValue())
+ {
+ anArgIter += 2;
+ aTrsfPers->SetOffset2d (Graphic3d_Vec2i (anX.IntegerValue(), anY.IntegerValue()));
+ }
+ }
+ }
+ }
}
else if (aNameCase == "-trsfpers"
|| aNameCase == "-pers")
{
- if (++anArgIter >= theArgNb)
+ if (++anArgIter >= theArgNb
+ || !aTrsfPers.IsNull())
{
std::cerr << "Error: wrong syntax at " << aName << ".\n";
return 1;
}
toSetTrsfPers = Standard_True;
- aTrsfPersFlags = Graphic3d_TMF_None;
+ Graphic3d_TransModeFlags aTrsfPersFlags = Graphic3d_TMF_None;
TCollection_AsciiString aPersFlags (theArgVec [anArgIter]);
aPersFlags.LowerCase();
- for (Standard_Integer aParserPos = aPersFlags.Search ("|");; aParserPos = aPersFlags.Search ("|"))
+ if (!parseTrsfPersFlag (aPersFlags, aTrsfPersFlags))
{
- if (aParserPos == -1)
- {
- if (!parseTrsfPersFlag (aPersFlags, aTrsfPersFlags))
- {
- std::cerr << "Error: wrong transform persistence flags " << theArgVec [anArgIter] << ".\n";
- return 1;
- }
- break;
- }
+ std::cerr << "Error: wrong transform persistence flags " << theArgVec [anArgIter] << ".\n";
+ return 1;
+ }
- TCollection_AsciiString anOtherFlags = aPersFlags.Split (aParserPos - 1);
- if (!parseTrsfPersFlag (aPersFlags, aTrsfPersFlags))
- {
- std::cerr << "Error: wrong transform persistence flags " << theArgVec [anArgIter] << ".\n";
- return 1;
- }
- aPersFlags = anOtherFlags;
+ if (aTrsfPersFlags == Graphic3d_TMF_TriedronPers)
+ {
+ aTrsfPers = new Graphic3d_TransformPers (Graphic3d_TMF_TriedronPers, Aspect_TOTP_LEFT_LOWER);
+ }
+ else if (aTrsfPersFlags != Graphic3d_TMF_None)
+ {
+ aTrsfPers = new Graphic3d_TransformPers (aTrsfPersFlags, gp_Pnt());
}
}
else if (aNameCase == "-trsfperspos"
|| aNameCase == "-perspos")
{
- if (anArgIter + 2 >= theArgNb)
+ if (anArgIter + 2 >= theArgNb
+ || aTrsfPers.IsNull())
{
std::cerr << "Error: wrong syntax at " << aName << ".\n";
return 1;
TCollection_AsciiString aX (theArgVec[++anArgIter]);
TCollection_AsciiString aY (theArgVec[++anArgIter]);
TCollection_AsciiString aZ = "0";
- if (!aX.IsIntegerValue()
- || !aY.IsIntegerValue())
+ if (!aX.IsRealValue()
+ || !aY.IsRealValue())
{
std::cerr << "Error: wrong syntax at " << aName << ".\n";
return 1;
if (anArgIter + 1 < theArgNb)
{
TCollection_AsciiString aTemp = theArgVec[anArgIter + 1];
- if (aTemp.IsIntegerValue())
+ if (aTemp.IsRealValue())
{
aZ = aTemp;
++anArgIter;
}
}
- aTPPosition.SetCoord (aX.IntegerValue(), aY.IntegerValue(), aZ.IntegerValue());
+
+ const gp_Pnt aPnt (aX.RealValue(), aY.RealValue(), aZ.RealValue());
+ if (aTrsfPers->IsZoomOrRotate())
+ {
+ aTrsfPers->SetAnchorPoint (aPnt);
+ }
+ else if (aTrsfPers->IsTrihedronOr2d())
+ {
+ aTrsfPers = Graphic3d_TransformPers::FromDeprecatedParams (aTrsfPers->Mode(), aPnt);
+ }
}
else if (aNameCase == "-layer")
{
}
// Prepare context for display
+ Standard_DISABLE_DEPRECATION_WARNINGS
if (toDisplayLocal && !aCtx->HasOpenedContext())
{
aCtx->OpenLocalContext (Standard_False);
{
aCtx->CloseAllContexts (Standard_False);
}
+ Standard_ENABLE_DEPRECATION_WARNINGS
// Display interactive objects
for (Standard_Integer anIter = 1; anIter <= aNamesOfDisplayIO.Length(); ++anIter)
}
if (toSetTrsfPers)
{
- aShape->SetTransformPersistence (aTrsfPersFlags, aTPPosition);
+ aCtx->SetTransformPersistence (aShape, aTrsfPers);
}
if (anObjDispMode != -2)
{
aDispStatus);
if (toDisplayInView)
{
- for (aCtx->CurrentViewer()->InitDefinedViews(); aCtx->CurrentViewer()->MoreDefinedViews(); aCtx->CurrentViewer()->NextDefinedViews())
+ for (V3d_ListOfViewIterator aViewIter (aCtx->CurrentViewer()->DefinedViewIterator()); aViewIter.More(); aViewIter.Next())
{
- aCtx->SetViewAffinity (aShape, aCtx->CurrentViewer()->DefinedView(), Standard_False);
+ aCtx->SetViewAffinity (aShape, aViewIter.Value(), Standard_False);
}
aCtx->SetViewAffinity (aShape, ViewerTest::CurrentView(), Standard_True);
}
}
if (toSetTrsfPers)
{
- aShape->SetTransformPersistence (aTrsfPersFlags, aTPPosition);
+ aCtx->SetTransformPersistence (aShape, aTrsfPers);
}
if (anObjDispMode != -2)
{
static int VPerf(Draw_Interpretor& di, Standard_Integer , const char** argv) {
OSD_Timer myTimer;
- if (TheAISContext()->HasOpenedContext())
- TheAISContext()->CloseLocalContext();
-
Standard_Real Step=4*M_PI/180;
Standard_Real Angle=0;
return 0;
}
-
-//==================================================================================
-// Function : VAnimation
-//==================================================================================
-static int VAnimation (Draw_Interpretor& di, Standard_Integer argc, const char** argv) {
- if (argc != 5) {
- di<<"Use: "<<argv[0]<<" CrankArmFile CylinderHeadFile PropellerFile EngineBlockFile\n";
- return 1;
- }
-
- Standard_Real thread = 4;
- Standard_Real angleA=0;
- Standard_Real angleB;
- Standard_Real X;
- gp_Ax1 Ax1(gp_Pnt(0,0,0),gp_Vec(0,0,1));
-
- BRep_Builder B;
- TopoDS_Shape CrankArm;
- TopoDS_Shape CylinderHead;
- TopoDS_Shape Propeller;
- TopoDS_Shape EngineBlock;
-
- //BRepTools::Read(CrankArm,"/dp_26/Indus/ege/assemblage/CrankArm.rle",B);
- //BRepTools::Read(CylinderHead,"/dp_26/Indus/ege/assemblage/CylinderHead.rle",B);
- //BRepTools::Read(Propeller,"/dp_26/Indus/ege/assemblage/Propeller.rle",B);
- //BRepTools::Read(EngineBlock,"/dp_26/Indus/ege/assemblage/EngineBlock.rle",B);
- BRepTools::Read(CrankArm,argv[1],B);
- BRepTools::Read(CylinderHead,argv[2],B);
- BRepTools::Read(Propeller,argv[3],B);
- BRepTools::Read(EngineBlock,argv[4],B);
-
- if (CrankArm.IsNull() || CylinderHead.IsNull() || Propeller.IsNull() || EngineBlock.IsNull()) {di<<" Syntaxe error:loading failure.\n";}
-
-
- OSD_Timer myTimer;
- myTimer.Start();
-
- Handle(AIS_Shape) myAisCylinderHead = new AIS_Shape (CylinderHead);
- Handle(AIS_Shape) myAisEngineBlock = new AIS_Shape (EngineBlock);
- Handle(AIS_Shape) myAisCrankArm = new AIS_Shape (CrankArm);
- Handle(AIS_Shape) myAisPropeller = new AIS_Shape (Propeller);
-
- GetMapOfAIS().Bind(myAisCylinderHead,"a");
- GetMapOfAIS().Bind(myAisEngineBlock,"b");
- GetMapOfAIS().Bind(myAisCrankArm,"c");
- GetMapOfAIS().Bind(myAisPropeller,"d");
-
- myAisCylinderHead->SetMutable (Standard_True);
- myAisEngineBlock ->SetMutable (Standard_True);
- myAisCrankArm ->SetMutable (Standard_True);
- myAisPropeller ->SetMutable (Standard_True);
-
- TheAISContext()->SetColor (myAisCylinderHead, Quantity_NOC_INDIANRED);
- TheAISContext()->SetColor (myAisEngineBlock, Quantity_NOC_RED);
- TheAISContext()->SetColor (myAisPropeller, Quantity_NOC_GREEN);
-
- TheAISContext()->Display (myAisCylinderHead, Standard_False);
- TheAISContext()->Display (myAisEngineBlock, Standard_False);
- TheAISContext()->Display (myAisCrankArm, Standard_False);
- TheAISContext()->Display (myAisPropeller, Standard_False);
-
- TheAISContext()->Deactivate(myAisCylinderHead);
- TheAISContext()->Deactivate(myAisEngineBlock );
- TheAISContext()->Deactivate(myAisCrankArm );
- TheAISContext()->Deactivate(myAisPropeller );
-
- // Boucle de mouvement
- for (Standard_Real myAngle = 0;angleA<2*M_PI*10.175 ;myAngle++) {
-
- angleA = thread*myAngle*M_PI/180;
- X = Sin(angleA)*3/8;
- angleB = atan(X / Sqrt(-X * X + 1));
- Standard_Real decal(25*0.6);
-
-
- //Build a transformation on the display
- gp_Trsf aPropellerTrsf;
- aPropellerTrsf.SetRotation(Ax1,angleA);
- TheAISContext()->SetLocation(myAisPropeller,aPropellerTrsf);
-
- gp_Ax3 base(gp_Pnt(3*decal*(1-Cos(angleA)),-3*decal*Sin(angleA),0),gp_Vec(0,0,1),gp_Vec(1,0,0));
- gp_Trsf aCrankArmTrsf;
- aCrankArmTrsf.SetTransformation( base.Rotated(gp_Ax1(gp_Pnt(3*decal,0,0),gp_Dir(0,0,1)),angleB));
- TheAISContext()->SetLocation(myAisCrankArm,aCrankArmTrsf);
-
- TheAISContext()->UpdateCurrentViewer();
- }
-
- TopoDS_Shape myNewCrankArm =myAisCrankArm ->Shape().Located( myAisCrankArm ->Transformation() );
- TopoDS_Shape myNewPropeller =myAisPropeller->Shape().Located( myAisPropeller->Transformation() );
-
- myAisCrankArm ->ResetTransformation();
- myAisPropeller->ResetTransformation();
-
- myAisCrankArm -> Set(myNewCrankArm );
- myAisPropeller -> Set(myNewPropeller);
-
- TheAISContext()->Activate(myAisCylinderHead,0);
- TheAISContext()->Activate(myAisEngineBlock,0 );
- TheAISContext()->Activate(myAisCrankArm ,0 );
- TheAISContext()->Activate(myAisPropeller ,0 );
-
- myTimer.Stop();
- myTimer.Show();
- myTimer.Start();
-
- TheAISContext()->Redisplay(myAisCrankArm ,Standard_False);
- TheAISContext()->Redisplay(myAisPropeller,Standard_False);
-
- TheAISContext()->UpdateCurrentViewer();
- a3DView()->Redraw();
-
- myTimer.Stop();
- myTimer.Show();
-
- return 0;
-
-}
-
//==============================================================================
//function : VShading
//purpose : Sharpen or roughten the quality of the shading
// Verifications
const Standard_Boolean HaveToSet = (strcasecmp(argv[0],"vsetshading") == 0);
-
- if (TheAISContext()->HasOpenedContext())
- TheAISContext()->CloseLocalContext();
-
if (argc < 3) {
myDevCoef = 0.0008;
} else {
if (argc<2||argc>3) { di<<" Syntaxe error\n";return 1;}
ThereIsName = (argc == 3);
}
- else {
+ else
+ {
+ Standard_DISABLE_DEPRECATION_WARNINGS
// vunsetam
if (argc>1) {di<<" Syntaxe error\n";return 1;}
else {
di<<" R.A.Z de tous les modes de selecion\n";
di<<" Fermeture du Context local\n";
if (TheAISContext()->HasOpenedContext())
+ {
TheAISContext()->CloseLocalContext();
+ }
}
+ Standard_ENABLE_DEPRECATION_WARNINGS
}
// IL n'y a aps de nom de shape passe en argument
}
}
+ Standard_DISABLE_DEPRECATION_WARNINGS
TheAISContext()->OpenLocalContext(Standard_False);
+ Standard_ENABLE_DEPRECATION_WARNINGS
ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName
it (GetMapOfAIS());
while(it.More()){
}
if( !TheAISContext()->HasOpenedContext() ) {
+ Standard_DISABLE_DEPRECATION_WARNINGS
TheAISContext()->OpenLocalContext(Standard_False);
+ Standard_ENABLE_DEPRECATION_WARNINGS
// On charge tous les objets de la map
ViewerTest_DoubleMapIteratorOfDoubleMapOfInteractiveAndName it (GetMapOfAIS());
while(it.More()){
template <typename T>
static void printLocalSelectionInfo (const T& theContext, Draw_Interpretor& theDI)
{
- const Standard_Boolean isGlobalCtx = !(Handle(AIS_InteractiveContext)::DownCast (theContext).IsNull());
+ const Standard_Boolean isGlobalCtx = (theContext->DynamicType() == STANDARD_TYPE(AIS_InteractiveContext));
TCollection_AsciiString aPrevName;
for (theContext->InitSelected(); theContext->MoreSelected(); theContext->NextSelected())
{
if (toPrintEntities)
{
theDI << "Detected entities:\n";
+ Standard_DISABLE_DEPRECATION_WARNINGS
Handle(StdSelect_ViewerSelector3d) aSelector = aCtx->HasOpenedContext() ? aCtx->LocalSelector() : aCtx->MainSelector();
+ Standard_ENABLE_DEPRECATION_WARNINGS
SelectMgr_SelectingVolumeManager aMgr = aSelector->GetManager();
- for (aSelector->InitDetected(); aSelector->MoreDetected(); aSelector->NextDetected())
+ for (Standard_Integer aPickIter = 1; aPickIter <= aSelector->NbPicked(); ++aPickIter)
{
- const Handle(SelectBasics_SensitiveEntity)& anEntity = aSelector->DetectedEntity();
+ const SelectMgr_SortCriterion& aPickData = aSelector->PickedData (aPickIter);
+ const Handle(SelectBasics_SensitiveEntity)& anEntity = aSelector->PickedEntity (aPickIter);
Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anEntity->OwnerId());
Handle(AIS_InteractiveObject) anObj = Handle(AIS_InteractiveObject)::DownCast (anOwner->Selectable());
- gp_Trsf anInvTrsf;
- if (anObj->TransformPersistence().Flags)
- {
- const Graphic3d_Mat4d& aProjection = aMgr.ProjectionMatrix();
- const Graphic3d_Mat4d& aWorldView = aMgr.WorldViewMatrix();
-
- Graphic3d_Mat4d aMat = anObj->TransformPersistence().Compute (aProjection, aWorldView, 0, 0);
- anInvTrsf.SetValues (aMat.GetValue (0, 0), aMat.GetValue (0, 1), aMat.GetValue (0, 2), aMat.GetValue (0, 3),
- aMat.GetValue (1, 0), aMat.GetValue (1, 1), aMat.GetValue (1, 2), aMat.GetValue (1, 3),
- aMat.GetValue (2, 0), aMat.GetValue (2, 1), aMat.GetValue (2, 2), aMat.GetValue (2, 3));
- anInvTrsf.Invert();
- }
- if (anObj->HasTransformation())
- {
- anInvTrsf = anObj->InversedTransformation() * anInvTrsf;
- }
- if (anEntity->HasInitLocation())
- {
- anInvTrsf = anEntity->InvInitLocation() * anInvTrsf;
- }
- const Standard_Integer aScale = anEntity->SensitivityFactor() < aSelector->PixelTolerance()
- ? anEntity->SensitivityFactor() : 1;
- const Standard_Boolean isToScaleAndTransform = anInvTrsf.Form() != gp_Identity || aScale != 1;
- SelectMgr_SelectingVolumeManager anEntMgr =
- isToScaleAndTransform ? aMgr.ScaleAndTransform (aScale, anInvTrsf)
- : aMgr;
- SelectBasics_PickResult aResult;
- anEntity->Matches (anEntMgr, aResult);
- gp_Pnt aDetectedPnt = anInvTrsf.Form() == gp_Identity ?
- anEntMgr.DetectedPoint (aResult.Depth()) : anEntMgr.DetectedPoint (aResult.Depth()).Transformed (anInvTrsf.Inverted());
-
TCollection_AsciiString aName = GetMapOfAIS().Find1 (anObj);
aName.LeftJustify (20, ' ');
char anInfoStr[512];
Sprintf (anInfoStr,
- " Depth: %+.3f Distance: %+.3f Point: %+.3f %+.3f %+.3f",
- aResult.Depth(),
- aResult.DistToGeomCenter(),
- aDetectedPnt.X(), aDetectedPnt.Y(), aDetectedPnt.Z());
+ " Depth: %g Distance: %g Point: %g %g %g",
+ aPickData.Depth,
+ aPickData.MinDist,
+ aPickData.Point.X(), aPickData.Point.Y(), aPickData.Point.Z());
theDI << " " << aName
<< anInfoStr
<< " (" << anEntity->DynamicType()->Name() << ")"
<< aSen->DynamicType()->Name()
<< "\n";
}
+
+ Handle(Select3D_SensitivePrimitiveArray) aPrimArr = Handle(Select3D_SensitivePrimitiveArray)::DownCast (anEntity);
+ if (!aPrimArr.IsNull())
+ {
+ theDI << " Detected Element: "
+ << aPrimArr->LastDetectedElement()
+ << "\n";
+ }
}
return 0;
}
NCollection_Map<Handle(AIS_InteractiveObject)> aDetected;
+ Standard_DISABLE_DEPRECATION_WARNINGS
for (aCtx->InitDetected(); aCtx->MoreDetected(); aCtx->NextDetected())
{
aDetected.Add (aCtx->DetectedCurrentObject());
}
+ Standard_ENABLE_DEPRECATION_WARNINGS
const Standard_Boolean toShowAll = (theArgNb >= 2 && *theArgVec[1] == '*');
if (theArgNb >= 2
theDI << "\n";
}
printLocalSelectionInfo (aCtx, theDI);
+ Standard_DISABLE_DEPRECATION_WARNINGS
if (aCtx->HasOpenedContext())
printLocalSelectionInfo (aCtx->LocalContext(), theDI);
+ Standard_ENABLE_DEPRECATION_WARNINGS
return 0;
}
const Standard_Integer MaxPick)
{
Handle(AIS_InteractiveObject) IO;
+ Standard_DISABLE_DEPRECATION_WARNINGS
Standard_Integer curindex = (TheType == AIS_KOI_None) ? 0 : TheAISContext()->OpenLocalContext();
+ Standard_ENABLE_DEPRECATION_WARNINGS
// step 1: prepare the data
if(curindex !=0){
arr->SetValue(i,IO2);
}
-
- if(curindex>0)
+ Standard_DISABLE_DEPRECATION_WARNINGS
+ if (curindex > 0)
+ {
TheAISContext()->CloseLocalContext(curindex);
+ }
+ Standard_ENABLE_DEPRECATION_WARNINGS
return Standard_True;
}
const Standard_Integer MaxPick)
{
Handle(AIS_InteractiveObject) IO;
+ Standard_DISABLE_DEPRECATION_WARNINGS
Standard_Integer curindex = (TheType == AIS_KOI_None) ? 0 : TheAISContext()->OpenLocalContext();
+ Standard_ENABLE_DEPRECATION_WARNINGS
// step 1: prepare the data
IO = TheAISContext()->SelectedInteractive();
}
- if(curindex!=0)
+ Standard_DISABLE_DEPRECATION_WARNINGS
+ if (curindex != 0)
+ {
TheAISContext()->CloseLocalContext(curindex);
+ }
+ Standard_ENABLE_DEPRECATION_WARNINGS
return IO;
}
{
// step 1: prepare the data
-
+ Standard_DISABLE_DEPRECATION_WARNINGS
Standard_Integer curindex = TheAISContext()->OpenLocalContext();
+ Standard_ENABLE_DEPRECATION_WARNINGS
TopoDS_Shape result;
if(TheType==TopAbs_SHAPE){
else{
Handle(StdSelect_ShapeTypeFilter) TF = new StdSelect_ShapeTypeFilter(TheType);
TheAISContext()->AddFilter(TF);
+ Standard_DISABLE_DEPRECATION_WARNINGS
TheAISContext()->ActivateStandardMode(TheType);
-
+ Standard_ENABLE_DEPRECATION_WARNINGS
}
}
}
- if(curindex>0)
+ Standard_DISABLE_DEPRECATION_WARNINGS
+ if (curindex > 0)
+ {
TheAISContext()->CloseLocalContext(curindex);
+ }
+ Standard_ENABLE_DEPRECATION_WARNINGS
return result;
}
cout<<" WARNING : Pick with Shift+ MB1 for Selection of more than 1 object\n";
// step 1: prepare the data
+ Standard_DISABLE_DEPRECATION_WARNINGS
Standard_Integer curindex = TheAISContext()->OpenLocalContext();
+ Standard_ENABLE_DEPRECATION_WARNINGS
if(TheType==TopAbs_SHAPE){
Handle(AIS_TypeFilter) F1 = new AIS_TypeFilter(AIS_KOI_Shape);
TheAISContext()->AddFilter(F1);
else{
Handle(StdSelect_ShapeTypeFilter) TF = new StdSelect_ShapeTypeFilter(TheType);
TheAISContext()->AddFilter(TF);
+ Standard_DISABLE_DEPRECATION_WARNINGS
TheAISContext()->ActivateStandardMode(TheType);
-
+ Standard_ENABLE_DEPRECATION_WARNINGS
}
// step 2 : wait for the selection...
}
}
+ Standard_DISABLE_DEPRECATION_WARNINGS
TheAISContext()->CloseLocalContext(curindex);
+ Standard_ENABLE_DEPRECATION_WARNINGS
return Standard_True;
}
}
// Prepare context
+ Standard_DISABLE_DEPRECATION_WARNINGS
if (isLocal && !aCtx->HasOpenedContext())
{
aCtx->OpenLocalContext (Standard_False);
{
aCtx->CloseAllContexts (Standard_False);
}
+ Standard_ENABLE_DEPRECATION_WARNINGS
// Load selection of interactive objects
for (Standard_Integer anIter = 1; anIter <= aNamesOfIO.Length(); ++anIter)
return 0;
}
-//==============================================================================
-//function : VAutoActivateSelection
-//purpose : Activates or deactivates auto computation of selection
-//==============================================================================
-static int VAutoActivateSelection (Draw_Interpretor& theDi,
- Standard_Integer theArgNb,
- const char** theArgVec)
-{
-
- if (theArgNb > 2)
- {
- std::cerr << theArgVec[0] << "Error: wrong number of arguments.\n";
- return 1;
- }
-
- Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
- if (aCtx.IsNull())
- {
- ViewerTest::ViewerInit();
- aCtx = ViewerTest::GetAISContext();
- }
-
- if (theArgNb == 1)
- {
- TCollection_AsciiString aSelActivationString;
- if (aCtx->GetAutoActivateSelection())
- {
- aSelActivationString.Copy ("ON");
- }
- else
- {
- aSelActivationString.Copy ("OFF");
- }
-
- theDi << "Auto activation of selection is: " << aSelActivationString << "\n";
- }
- else
- {
- Standard_Boolean toActivate = Draw::Atoi (theArgVec[1]);
- aCtx->SetAutoActivateSelection (toActivate);
- }
-
- return 0;
-}
-
//==============================================================================
//function : ViewerTest::Commands
//purpose : Add all the viewer command in the Draw_Interpretor
theCommands.Add("vdisplay",
"vdisplay [-noupdate|-update] [-local] [-mutable] [-neutral]"
- "\n\t\t: [-trsfPers {pan|zoom|rotate|trihedron|full|none}=none] [-trsfPersPos X Y [Z]] [-3d|-2d|-2dTopDown]"
+ "\n\t\t: [-trsfPers {zoom|rotate|zoomRotate|none}=none]"
+ "\n\t\t: [-trsfPersPos X Y [Z]] [-3d]"
+ "\n\t\t: [-2d|-trihedron [{top|bottom|left|right|topLeft"
+ "\n\t\t: |topRight|bottomLeft|bottomRight}"
+ "\n\t\t: [offsetX offsetY]]]"
"\n\t\t: [-dispMode mode] [-highMode mode]"
"\n\t\t: [-layer index] [-top|-topmost|-overlay|-underlay]"
"\n\t\t: [-redisplay]"
"\n\t\t: Option -local enables displaying of objects in local"
"\n\t\t: selection context. Local selection context will be opened"
"\n\t\t: if there is not any."
- "\n\t\t: -noupdate suppresses viewer redraw call."
- "\n\t\t: -mutable enables optimizations for mutable objects."
- "\n\t\t: -neutral draws objects in main viewer."
- "\n\t\t: -layer sets z-layer for objects. It can use -overlay|-underlay|-top|-topmost instead of -layer index for the default z-layers."
- "\n\t\t: -top draws objects on top of main presentations but below topmost."
- "\n\t\t: -topmost draws in overlay for 3D presentations with independent Depth."
- "\n\t\t: -overlay draws objects in overlay for 2D presentations (On-Screen-Display)."
- "\n\t\t: -underlay draws objects in underlay for 2D presentations (On-Screen-Display)."
- "\n\t\t: -selectable|-noselect controls selection of objects."
- "\n\t\t: -trsfPers sets a transform persistence flags. Flag 'full' is pan, zoom and rotate."
- "\n\t\t: -trsfPersPos sets an anchor point for transform persistence."
- "\n\t\t: -2d|-2dTopDown displays object in screen coordinates."
- "\n\t\t: -dispmode sets display mode for objects."
- "\n\t\t: -highmode sets hilight mode for objects."
- "\n\t\t: -redisplay recomputes presentation of objects.",
+ "\n\t\t: -noupdate Suppresses viewer redraw call."
+ "\n\t\t: -mutable Enables optimizations for mutable objects."
+ "\n\t\t: -neutral Draws objects in main viewer."
+ "\n\t\t: -layer Sets z-layer for objects."
+ "\n\t\t: Alternatively -overlay|-underlay|-top|-topmost"
+ "\n\t\t: options can be used for the default z-layers."
+ "\n\t\t: -top Draws object on top of main presentations"
+ "\n\t\t: but below topmost."
+ "\n\t\t: -topmost Draws in overlay for 3D presentations."
+ "\n\t\t: with independent Depth."
+ "\n\t\t: -overlay Draws objects in overlay for 2D presentations."
+ "\n\t\t: (On-Screen-Display)"
+ "\n\t\t: -underlay Draws objects in underlay for 2D presentations."
+ "\n\t\t: (On-Screen-Display)"
+ "\n\t\t: -selectable|-noselect Controls selection of objects."
+ "\n\t\t: -trsfPers Sets a transform persistence flags."
+ "\n\t\t: -trsfPersPos Sets an anchor point for transform persistence."
+ "\n\t\t: -2d Displays object in screen coordinates."
+ "\n\t\t: (DY looks up)"
+ "\n\t\t: -dispmode Sets display mode for objects."
+ "\n\t\t: -highmode Sets hilight mode for objects."
+ "\n\t\t: -redisplay Recomputes presentation of objects.",
__FILE__, VDisplay2, group);
theCommands.Add ("vupdate",
"vdisplaytype : vdisplaytype <Type> <Signature> \n\t display all the objects of one given kind (see vtypes) which are stored the AISContext ",
__FILE__,VDisplayType,group);
- theCommands.Add("vdisplaymode",
- "vdispmode : vdispmode [name] mode(1,2,..) : no name -> on selected objects ",
- __FILE__,VDispMode,group);
-
- theCommands.Add("verasemode",
- "verasemode : verasemode [name] mode(1,2,..) : no name -> on selected objects",
- __FILE__,VDispMode,group);
-
theCommands.Add("vsetdispmode",
"vsetdispmode [name] mode(1,2,..)"
"\n\t\t: Sets display mode for all, selected or named objects.",
"vdump <filename>." DUMP_FORMATS " [-width Width -height Height]"
"\n\t\t: [-buffer rgb|rgba|depth=rgb]"
"\n\t\t: [-stereo mono|left|right|blend|sideBySide|overUnder=mono]"
+ "\n\t\t: [-tileSize Size=0]"
"\n\t\t: Dumps content of the active view into image file",
__FILE__,VDump,group);
"vsensera : erase active entities",
__FILE__,VClearSensi,group);
- theCommands.Add("vselprecision",
- "vselprecision [-unset] [tolerance_value]"
- "\n\t\t Manages selection precision or prints current value if no parameter is passed."
- "\n\t\t -unset - restores default selection tolerance behavior, based on individual entity tolerance",
- __FILE__,VSelPrecision,group);
-
theCommands.Add("vperf",
"vperf: vperf ShapeName 1/0(Transfo/Location) 1/0(Primitives sensibles ON/OFF)"
"\n\t\t: Tests the animation of an object along a predefined trajectory.",
__FILE__,VPerf,group);
- theCommands.Add("vanimation",
- "vanimation CrankArmFile CylinderHeadFile PropellerFile EngineBlockFile",
- __FILE__,VAnimation,group);
-
theCommands.Add("vsetshading",
"vsetshading : vsetshading name Quality(default=0.0008) "
"\n\t\t: Sets deflection coefficient that defines the quality of the shape representation in the shading mode.",
"\n\t\t: -local - open local context before selection computation",
__FILE__, VLoadSelection, group);
- theCommands.Add ("vautoactivatesel",
- "vautoactivatesel [0|1] : manage or display the option to automatically"
- "\n\t\t: activate selection for newly displayed objects"
- "\n\t\t: [0|1] - turn off | on auto activation of selection",
- __FILE__, VAutoActivateSelection, group);
-
theCommands.Add("vbsdf", "vbsdf [name] [options]"
"\nAdjusts parameters of material BSDF:"
"\n -help : Shows this message"
{
// definition of Viewer Command
ViewerTest::Commands(theDI);
- ViewerTest::AviCommands(theDI);
#ifdef OCCT_DEBUG
theDI << "Draw Plugin : OCC V2d & V3d commands are loaded\n";