Open CASCADE Technology  7.1.0.beta
Static Public Member Functions

ViewerTest Class Reference

#include <ViewerTest.hxx>

Static Public Member Functions

static void Factory (Draw_Interpretor &theDI)
 Loads all Draw commands of V2d & V3d. Used for plugin. More...
 
static TCollection_AsciiString ViewerInit (const Standard_Integer thePxLeft=0, const Standard_Integer thePxTop=0, const Standard_Integer thePxWidth=0, const Standard_Integer thePxHeight=0, const Standard_CString theViewName="", const Standard_CString theDisplayName="")
 Creates view with default or custom name and add this name in map to manage muliple views implemented in ViewerTest_ViewerCommands.cxx. More...
 
static void RemoveViewName (const TCollection_AsciiString &theName)
 
static void InitViewName (const TCollection_AsciiString &theName, const Handle< V3d_View > &theView)
 
static TCollection_AsciiString GetCurrentViewName ()
 
static void RemoveView (const TCollection_AsciiString &theViewName, const Standard_Boolean theToRemoveContext=Standard_True)
 Removes view and clear all maps with information about its resources if necessary. More...
 
static void RemoveView (const Handle< V3d_View > &theView, const Standard_Boolean theToRemoveContext=Standard_True)
 Removes view and clear all maps with information about its resources if necessary. More...
 
static Standard_Boolean Display (const TCollection_AsciiString &theName, const Handle< AIS_InteractiveObject > &theObject, const Standard_Boolean theToUpdate=Standard_True, const Standard_Boolean theReplaceIfExists=Standard_True)
 Display AIS object in active Viewer and register it in the map of Interactive Objects with specified name. More...
 
static TopoDS_Shape PickShape (const TopAbs_ShapeEnum aType, const Standard_Integer MaxPick=5)
 waits until a shape of type <aType> is picked in the AIS Viewer and returns it. if <aType> == TopAbs_Shape, any shape can be picked... MaxPick is the Max number before exiting, if no pick is successful More...
 
static Standard_Boolean PickShapes (const TopAbs_ShapeEnum aType, Handle< TopTools_HArray1OfShape > &thepicked, const Standard_Integer MaxPick=5)
 wait until the array is filled with picked shapes. returns True if the array is filled. exit if number of unsuccessful picks = <MaxPick> More...
 
static Handle< AIS_InteractiveObjectPickObject (const AIS_KindOfInteractive Type=AIS_KOI_None, const Standard_Integer Signature=-1, const Standard_Integer MaxPick=5)
 waits until an interactive object of a given Type and signature is picked (default values authorize selection of any Interactive Object) exit if number of unsuccessful picks = <MaxPick> More...
 
static Standard_Boolean PickObjects (Handle< TColStd_HArray1OfTransient > &thepicked, const AIS_KindOfInteractive Type=AIS_KOI_None, const Standard_Integer Signature=-1, const Standard_Integer MaxPick=5)
 selection of several interactive objects. Number is given by the size of <thepicked> exit if number of unsuccesfull picks = <MaxPick> More...
 
static void Commands (Draw_Interpretor &theCommands)
 
static void ViewerCommands (Draw_Interpretor &theCommands)
 
static void MyCommands (Draw_Interpretor &theCommands)
 
static void RelationCommands (Draw_Interpretor &theCommands)
 
static void ObjectCommands (Draw_Interpretor &theCommands)
 
static void FilletCommands (Draw_Interpretor &theCommands)
 
static void OpenGlCommands (Draw_Interpretor &theCommands)
 
static void GetMousePosition (Standard_Integer &xpix, Standard_Integer &ypix)
 
static Handle< V3d_ViewerGetViewerFromContext ()
 
static Handle< V3d_ViewerGetCollectorFromContext ()
 
static const Handle< AIS_InteractiveContext > & GetAISContext ()
 
static void SetAISContext (const Handle< AIS_InteractiveContext > &aContext)
 
static const Handle< V3d_View > & CurrentView ()
 
static void CurrentView (const Handle< V3d_View > &aViou)
 
static void Clear ()
 
static void SetEventManager (const Handle< ViewerTest_EventManager > &theMgr)
 puts theMgr as current eventmanager (the move,select,...will be applied to theMgr) More...
 
static void UnsetEventManager ()
 removes the last EventManager from the list. More...
 
static void ResetEventManager ()
 clear the list of EventManagers and sets the default EventManager as current More...
 
static Handle< ViewerTest_EventManagerCurrentEventManager ()
 
static void RemoveSelected ()
 
static void StandardModeActivation (const Standard_Integer Mode)
 
static Quantity_NameOfColor GetColorFromName (const Standard_CString name)
 
static Standard_Integer ParseColor (Standard_Integer theArgNb, const char **theArgVec, Quantity_Color &theColor)
 Parses color argument(s) specified within theArgVec[0], theArgVec[1] and theArgVec[2]. Handles either color specified by name (single argument) or by RGB components (3 arguments) in range 0..1. The result is stored in theColor on success. Returns number of handled arguments (1 or 3) or 0 on syntax error. More...
 
static void RedrawAllViews ()
 redraws all defined views. More...
 
static Standard_Boolean SplitParameter (const TCollection_AsciiString &theString, TCollection_AsciiString &theName, TCollection_AsciiString &theValue)
 Splits "parameter=value" string into separate parameter and value strings. More...
 
static Standard_Boolean ParseOnOff (Standard_CString theArg, Standard_Boolean &theIsOn)
 Parses boolean argument. Handles either flag specified by 0|1 or on|off. More...
 

Member Function Documentation

static void ViewerTest::Clear ( )
static
static void ViewerTest::Commands ( Draw_Interpretor theCommands)
static
static Handle< ViewerTest_EventManager > ViewerTest::CurrentEventManager ( )
static
static const Handle< V3d_View >& ViewerTest::CurrentView ( )
static
static void ViewerTest::CurrentView ( const Handle< V3d_View > &  aViou)
static
static Standard_Boolean ViewerTest::Display ( const TCollection_AsciiString theName,
const Handle< AIS_InteractiveObject > &  theObject,
const Standard_Boolean  theToUpdate = Standard_True,
const Standard_Boolean  theReplaceIfExists = Standard_True 
)
static

Display AIS object in active Viewer and register it in the map of Interactive Objects with specified name.

Parameters
theNamekey to be associated to displayed interactive object
theObjectobject to display
theToUpdateredraw viewer after displaying object
theReplaceIfExistsreplace the object assigned to specified key
Returns
true if new object has been displayed
static void ViewerTest::Factory ( Draw_Interpretor theDI)
static

Loads all Draw commands of V2d & V3d. Used for plugin.

static void ViewerTest::FilletCommands ( Draw_Interpretor theCommands)
static
static const Handle< AIS_InteractiveContext >& ViewerTest::GetAISContext ( )
static
static Handle< V3d_Viewer > ViewerTest::GetCollectorFromContext ( )
static
static Quantity_NameOfColor ViewerTest::GetColorFromName ( const Standard_CString  name)
static
static TCollection_AsciiString ViewerTest::GetCurrentViewName ( )
static
static void ViewerTest::GetMousePosition ( Standard_Integer xpix,
Standard_Integer ypix 
)
static
static Handle< V3d_Viewer > ViewerTest::GetViewerFromContext ( )
static
static void ViewerTest::InitViewName ( const TCollection_AsciiString theName,
const Handle< V3d_View > &  theView 
)
static
static void ViewerTest::MyCommands ( Draw_Interpretor theCommands)
static
static void ViewerTest::ObjectCommands ( Draw_Interpretor theCommands)
static
static void ViewerTest::OpenGlCommands ( Draw_Interpretor theCommands)
static
static Standard_Integer ViewerTest::ParseColor ( Standard_Integer  theArgNb,
const char **  theArgVec,
Quantity_Color theColor 
)
static

Parses color argument(s) specified within theArgVec[0], theArgVec[1] and theArgVec[2]. Handles either color specified by name (single argument) or by RGB components (3 arguments) in range 0..1. The result is stored in theColor on success. Returns number of handled arguments (1 or 3) or 0 on syntax error.

static Standard_Boolean ViewerTest::ParseOnOff ( Standard_CString  theArg,
Standard_Boolean theIsOn 
)
static

Parses boolean argument. Handles either flag specified by 0|1 or on|off.

static Handle< AIS_InteractiveObject > ViewerTest::PickObject ( const AIS_KindOfInteractive  Type = AIS_KOI_None,
const Standard_Integer  Signature = -1,
const Standard_Integer  MaxPick = 5 
)
static

waits until an interactive object of a given Type and signature is picked (default values authorize selection of any Interactive Object) exit if number of unsuccessful picks = <MaxPick>

static Standard_Boolean ViewerTest::PickObjects ( Handle< TColStd_HArray1OfTransient > &  thepicked,
const AIS_KindOfInteractive  Type = AIS_KOI_None,
const Standard_Integer  Signature = -1,
const Standard_Integer  MaxPick = 5 
)
static

selection of several interactive objects. Number is given by the size of <thepicked> exit if number of unsuccesfull picks = <MaxPick>

static TopoDS_Shape ViewerTest::PickShape ( const TopAbs_ShapeEnum  aType,
const Standard_Integer  MaxPick = 5 
)
static

waits until a shape of type <aType> is picked in the AIS Viewer and returns it. if <aType> == TopAbs_Shape, any shape can be picked... MaxPick is the Max number before exiting, if no pick is successful

static Standard_Boolean ViewerTest::PickShapes ( const TopAbs_ShapeEnum  aType,
Handle< TopTools_HArray1OfShape > &  thepicked,
const Standard_Integer  MaxPick = 5 
)
static

wait until the array is filled with picked shapes. returns True if the array is filled. exit if number of unsuccessful picks = <MaxPick>

static void ViewerTest::RedrawAllViews ( )
static

redraws all defined views.

static void ViewerTest::RelationCommands ( Draw_Interpretor theCommands)
static
static void ViewerTest::RemoveSelected ( )
static
static void ViewerTest::RemoveView ( const TCollection_AsciiString theViewName,
const Standard_Boolean  theToRemoveContext = Standard_True 
)
static

Removes view and clear all maps with information about its resources if necessary.

static void ViewerTest::RemoveView ( const Handle< V3d_View > &  theView,
const Standard_Boolean  theToRemoveContext = Standard_True 
)
static

Removes view and clear all maps with information about its resources if necessary.

static void ViewerTest::RemoveViewName ( const TCollection_AsciiString theName)
static
static void ViewerTest::ResetEventManager ( )
static

clear the list of EventManagers and sets the default EventManager as current

static void ViewerTest::SetAISContext ( const Handle< AIS_InteractiveContext > &  aContext)
static
static void ViewerTest::SetEventManager ( const Handle< ViewerTest_EventManager > &  theMgr)
static

puts theMgr as current eventmanager (the move,select,...will be applied to theMgr)

static Standard_Boolean ViewerTest::SplitParameter ( const TCollection_AsciiString theString,
TCollection_AsciiString theName,
TCollection_AsciiString theValue 
)
static

Splits "parameter=value" string into separate parameter and value strings.

Returns
TRUE if the string matches pattern "<string>=<empty or string>"
static void ViewerTest::StandardModeActivation ( const Standard_Integer  Mode)
static
static void ViewerTest::UnsetEventManager ( )
static

removes the last EventManager from the list.

static void ViewerTest::ViewerCommands ( Draw_Interpretor theCommands)
static
static TCollection_AsciiString ViewerTest::ViewerInit ( const Standard_Integer  thePxLeft = 0,
const Standard_Integer  thePxTop = 0,
const Standard_Integer  thePxWidth = 0,
const Standard_Integer  thePxHeight = 0,
const Standard_CString  theViewName = "",
const Standard_CString  theDisplayName = "" 
)
static

Creates view with default or custom name and add this name in map to manage muliple views implemented in ViewerTest_ViewerCommands.cxx.


The documentation for this class was generated from the following file: