Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
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.
 
static TCollection_AsciiString ViewerInit (const ViewerTest_VinitParams &theParams)
 Creates view with default or custom name and adds this name in map to manage multiple views. Implemented in ViewerTest_ViewerCommands.cxx.
 
static TCollection_AsciiString ViewerInit (const TCollection_AsciiString &theViewName="")
 Creates view.
 
static TCollection_AsciiString ViewerInit (const int thePxLeft, const int thePxTop, const int thePxWidth, const int thePxHeight, const TCollection_AsciiString &theViewName, const TCollection_AsciiString &theDisplayName="", const occ::handle< V3d_View > &theViewToClone=occ::handle< V3d_View >(), const bool theIsVirtual=false)
 Creates view.
 
static void RemoveViewName (const TCollection_AsciiString &theName)
 
static void InitViewName (const TCollection_AsciiString &theName, const occ::handle< V3d_View > &theView)
 
static TCollection_AsciiString GetCurrentViewName ()
 
static void ActivateView (const occ::handle< V3d_View > &theView, bool theToUpdate)
 Make the view active.
 
static void RemoveView (const TCollection_AsciiString &theViewName, const bool theToRemoveContext=true)
 Removes view and clear all maps with information about its resources if necessary.
 
static void RemoveView (const occ::handle< V3d_View > &theView, const bool theToRemoveContext=true)
 Removes view and clear all maps with information about its resources if necessary.
 
static bool Display (const TCollection_AsciiString &theName, const occ::handle< AIS_InteractiveObject > &theObject, const bool theToUpdate=true, const bool theReplaceIfExists=true)
 Display AIS object in active Viewer and register it in the map of Interactive Objects with specified name.
 
static TopoDS_Shape PickShape (const TopAbs_ShapeEnum aType, const int 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
 
static bool PickShapes (const TopAbs_ShapeEnum aType, occ::handle< NCollection_HArray1< TopoDS_Shape > > &thepicked, const int 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>
 
static void Commands (Draw_Interpretor &theCommands)
 
static void ViewerCommands (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 (int &xpix, int &ypix)
 
static occ::handle< V3d_ViewerGetViewerFromContext ()
 
static occ::handle< V3d_ViewerGetCollectorFromContext ()
 
static const occ::handle< AIS_InteractiveContext > & GetAISContext ()
 
static void SetAISContext (const occ::handle< AIS_InteractiveContext > &aContext)
 
static const occ::handle< V3d_View > & CurrentView ()
 
static void CurrentView (const occ::handle< V3d_View > &aViou)
 
static void Clear ()
 
static void SetEventManager (const occ::handle< ViewerTest_EventManager > &theMgr)
 puts theMgr as current eventmanager (the move,select,...will be applied to theMgr)
 
static void UnsetEventManager ()
 removes the last EventManager from the list.
 
static void ResetEventManager ()
 clear the list of EventManagers and sets the default EventManager as current
 
static occ::handle< ViewerTest_EventManagerCurrentEventManager ()
 
static void RemoveSelected ()
 
static void RedrawAllViews ()
 redraws all defined views.
 
static bool SplitParameter (const TCollection_AsciiString &theString, TCollection_AsciiString &theName, TCollection_AsciiString &theValue)
 Splits "parameter=value" string into separate parameter and value strings.
 
static void GetSelectedShapes (NCollection_List< TopoDS_Shape > &theShapes)
 Returns list of selected shapes.
 
static bool ParseLineType (const char *theArg, Aspect_TypeOfLine &theType, uint16_t &thePattern)
 Parses line type argument. Handles either enumeration (integer) value or string constant.
 
static bool ParseLineType (const char *theArg, Aspect_TypeOfLine &theType)
 Parses line type argument. Handles either enumeration (integer) value or string constant.
 
static bool ParseMarkerType (const char *theArg, Aspect_TypeOfMarker &theType, occ::handle< Image_PixMap > &theImage)
 Parses marker type argument. Handles either enumeration (integer) value or string constant.
 
static bool ParseShadingModel (const char *theArg, Graphic3d_TypeOfShadingModel &theModel)
 Parses shading model argument. Handles either enumeration (integer) value or string constant.
 
static bool ParseZLayerName (const char *theArg, Graphic3d_ZLayerId &theLayer)
 Parses ZLayer name.
 
static bool ParseZLayer (const char *theArg, Graphic3d_ZLayerId &theLayer)
 Parses ZLayer name.
 
static bool ParseCorner (const char *theArg, Aspect_TypeOfTriedronPosition &theCorner)
 Auxiliary method to parse transformation persistence flags.
 

deprecated methods

Parses RGB(A) color argument(s) specified within theArgVec[0], theArgVec[1], theArgVec[2] and theArgVec[3].

Deprecated
("Method has been moved to Draw::ParseColor()")
static int ParseColor (const int theArgNb, const char *const *const theArgVec, Quantity_ColorRGBA &theColor)
 Parses RGB color argument(s). Returns number of handled arguments (1 or 3) or 0 on syntax error.
 
static int ParseColor (const int theArgNb, const char *const *const theArgVec, Quantity_Color &theColor)
 Parses RGB color argument(s). Returns number of handled arguments (1 or 3) or 0 on syntax error.
 
static bool ParseOnOff (const char *theArg, bool &theIsOn)
 Parses boolean argument. Handles either flag specified by 0|1 or on|off.
 
static Quantity_NameOfColor GetColorFromName (const char *const name)
 

Member Function Documentation

◆ ActivateView()

static void ViewerTest::ActivateView ( const occ::handle< V3d_View > & theView,
bool theToUpdate )
static

Make the view active.

◆ Clear()

static void ViewerTest::Clear ( )
static

◆ Commands()

static void ViewerTest::Commands ( Draw_Interpretor & theCommands)
static

◆ CurrentEventManager()

static occ::handle< ViewerTest_EventManager > ViewerTest::CurrentEventManager ( )
static

◆ CurrentView() [1/2]

static const occ::handle< V3d_View > & ViewerTest::CurrentView ( )
static

◆ CurrentView() [2/2]

static void ViewerTest::CurrentView ( const occ::handle< V3d_View > & aViou)
static

◆ Display()

static bool ViewerTest::Display ( const TCollection_AsciiString & theName,
const occ::handle< AIS_InteractiveObject > & theObject,
const bool theToUpdate = true,
const bool theReplaceIfExists = 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

◆ Factory()

static void ViewerTest::Factory ( Draw_Interpretor & theDI)
static

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

◆ FilletCommands()

static void ViewerTest::FilletCommands ( Draw_Interpretor & theCommands)
static

◆ GetAISContext()

static const occ::handle< AIS_InteractiveContext > & ViewerTest::GetAISContext ( )
static

◆ GetCollectorFromContext()

static occ::handle< V3d_Viewer > ViewerTest::GetCollectorFromContext ( )
static

◆ GetColorFromName()

static Quantity_NameOfColor ViewerTest::GetColorFromName ( const char *const name)
static
Deprecated
("Method has been moved to Quantity_Color::ColorFromName()")

◆ GetCurrentViewName()

static TCollection_AsciiString ViewerTest::GetCurrentViewName ( )
static

◆ GetMousePosition()

static void ViewerTest::GetMousePosition ( int & xpix,
int & ypix )
static

◆ GetSelectedShapes()

static void ViewerTest::GetSelectedShapes ( NCollection_List< TopoDS_Shape > & theShapes)
static

Returns list of selected shapes.

◆ GetViewerFromContext()

static occ::handle< V3d_Viewer > ViewerTest::GetViewerFromContext ( )
static

◆ InitViewName()

static void ViewerTest::InitViewName ( const TCollection_AsciiString & theName,
const occ::handle< V3d_View > & theView )
static

◆ ObjectCommands()

static void ViewerTest::ObjectCommands ( Draw_Interpretor & theCommands)
static

◆ OpenGlCommands()

static void ViewerTest::OpenGlCommands ( Draw_Interpretor & theCommands)
static

◆ ParseColor() [1/2]

static int ViewerTest::ParseColor ( const int theArgNb,
const char *const *const theArgVec,
Quantity_Color & theColor )
static

Parses RGB color argument(s). Returns number of handled arguments (1 or 3) or 0 on syntax error.

Deprecated
("Method has been moved to Draw::ParseColor()")

◆ ParseColor() [2/2]

static int ViewerTest::ParseColor ( const int theArgNb,
const char *const *const theArgVec,
Quantity_ColorRGBA & theColor )
static

Parses RGB color argument(s). Returns number of handled arguments (1 or 3) or 0 on syntax error.

Deprecated
("Method has been moved to Draw::ParseColor()")

◆ ParseCorner()

static bool ViewerTest::ParseCorner ( const char * theArg,
Aspect_TypeOfTriedronPosition & theCorner )
static

Auxiliary method to parse transformation persistence flags.

◆ ParseLineType() [1/2]

static bool ViewerTest::ParseLineType ( const char * theArg,
Aspect_TypeOfLine & theType )
inlinestatic

Parses line type argument. Handles either enumeration (integer) value or string constant.

◆ ParseLineType() [2/2]

static bool ViewerTest::ParseLineType ( const char * theArg,
Aspect_TypeOfLine & theType,
uint16_t & thePattern )
static

Parses line type argument. Handles either enumeration (integer) value or string constant.

◆ ParseMarkerType()

static bool ViewerTest::ParseMarkerType ( const char * theArg,
Aspect_TypeOfMarker & theType,
occ::handle< Image_PixMap > & theImage )
static

Parses marker type argument. Handles either enumeration (integer) value or string constant.

◆ ParseOnOff()

static bool ViewerTest::ParseOnOff ( const char * theArg,
bool & theIsOn )
static

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

Deprecated
("Method has been moved to Draw::ParseOnOff()")

◆ ParseShadingModel()

static bool ViewerTest::ParseShadingModel ( const char * theArg,
Graphic3d_TypeOfShadingModel & theModel )
static

Parses shading model argument. Handles either enumeration (integer) value or string constant.

◆ ParseZLayer()

static bool ViewerTest::ParseZLayer ( const char * theArg,
Graphic3d_ZLayerId & theLayer )
inlinestatic

Parses ZLayer name.

Parameters
[in]theArglayer name, enumeration alias or index (of existing Layer)
[out]theLayerlayer index
Returns
TRUE if layer has been identified, note that Graphic3d_ZLayerId_UNKNOWN is also valid value

◆ ParseZLayerName()

static bool ViewerTest::ParseZLayerName ( const char * theArg,
Graphic3d_ZLayerId & theLayer )
inlinestatic

Parses ZLayer name.

Parameters
[in]theArglayer name or enumeration alias
[out]theLayerlayer index
Returns
TRUE if layer has been identified, note that Graphic3d_ZLayerId_UNKNOWN is also valid value

◆ PickShape()

static TopoDS_Shape ViewerTest::PickShape ( const TopAbs_ShapeEnum aType,
const int 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

◆ PickShapes()

static bool ViewerTest::PickShapes ( const TopAbs_ShapeEnum aType,
occ::handle< NCollection_HArray1< TopoDS_Shape > > & thepicked,
const int 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>

◆ RedrawAllViews()

static void ViewerTest::RedrawAllViews ( )
static

redraws all defined views.

◆ RelationCommands()

static void ViewerTest::RelationCommands ( Draw_Interpretor & theCommands)
static

◆ RemoveSelected()

static void ViewerTest::RemoveSelected ( )
static

◆ RemoveView() [1/2]

static void ViewerTest::RemoveView ( const occ::handle< V3d_View > & theView,
const bool theToRemoveContext = true )
static

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

◆ RemoveView() [2/2]

static void ViewerTest::RemoveView ( const TCollection_AsciiString & theViewName,
const bool theToRemoveContext = true )
static

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

◆ RemoveViewName()

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

◆ ResetEventManager()

static void ViewerTest::ResetEventManager ( )
static

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

◆ SetAISContext()

static void ViewerTest::SetAISContext ( const occ::handle< AIS_InteractiveContext > & aContext)
static

◆ SetEventManager()

static void ViewerTest::SetEventManager ( const occ::handle< ViewerTest_EventManager > & theMgr)
static

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

◆ SplitParameter()

static bool 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>"

◆ UnsetEventManager()

static void ViewerTest::UnsetEventManager ( )
static

removes the last EventManager from the list.

◆ ViewerCommands()

static void ViewerTest::ViewerCommands ( Draw_Interpretor & theCommands)
static

◆ ViewerInit() [1/3]

static TCollection_AsciiString ViewerTest::ViewerInit ( const int thePxLeft,
const int thePxTop,
const int thePxWidth,
const int thePxHeight,
const TCollection_AsciiString & theViewName,
const TCollection_AsciiString & theDisplayName = "",
const occ::handle< V3d_View > & theViewToClone = occ::handle<V3d_View>(),
const bool theIsVirtual = false )
inlinestatic

Creates view.

◆ ViewerInit() [2/3]

static TCollection_AsciiString ViewerTest::ViewerInit ( const TCollection_AsciiString & theViewName = "")
inlinestatic

Creates view.

◆ ViewerInit() [3/3]

static TCollection_AsciiString ViewerTest::ViewerInit ( const ViewerTest_VinitParams & theParams)
static

Creates view with default or custom name and adds this name in map to manage multiple views. Implemented in ViewerTest_ViewerCommands.cxx.


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