primitive CommandFunction;
---Purpose: typedef Standard_Integer (*Draw_CommandFunction)
-- (Draw_Interpretor&, Standard_Integer, char**)
-
- class Interpretor;
- ---Purpose: Encapsulate the Tcl interpretor to add commands.
+
+ imported Interpretor;
+ ---Purpose: Encapsulate the Tcl interpretor to add commands.
class Printer;
---Purpose: Implements a printer class to connect Message_Messenger
+++ /dev/null
-// Created on: 1995-02-23
-// Created by: Remi LEQUETTE
-// Copyright (c) 1995-1999 Matra Datavision
-// Copyright (c) 1999-2014 OPEN CASCADE SAS
-//
-// This file is part of Open CASCADE Technology software library.
-//
-// This library is free software; you can redistribute it and / or modify it
-// under the terms of the GNU Lesser General Public version 2.1 as published
-// by the Free Software Foundation, with special exception defined in the file
-// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
-// distribution for complete text of the license and disclaimer of any warranty.
-//
-// Alternatively, this file may be used under the terms of Open CASCADE
-// commercial license or contractual agreement.
-
-#ifndef _Draw_CommandFunction_HeaderFile
-#define _Draw_CommandFunction_HeaderFile
-
-class Draw_Interpretor;
-
-typedef Standard_Integer (*Draw_CommandFunction)(Draw_Interpretor&, Standard_Integer, const char**);
-
-#endif
+++ /dev/null
--- Created on: 1995-02-23
--- Created by: Remi LEQUETTE
--- Copyright (c) 1995-1999 Matra Datavision
--- Copyright (c) 1999-2014 OPEN CASCADE SAS
---
--- This file is part of Open CASCADE Technology software library.
---
--- This library is free software; you can redistribute it and / or modify it
--- under the terms of the GNU Lesser General Public version 2.1 as published
--- by the Free Software Foundation, with special exception defined in the file
--- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
--- distribution for complete text of the license and disclaimer of any warranty.
---
--- Alternatively, this file may be used under the terms of Open CASCADE
--- commercial license or contractual agreement.
-
-class Interpretor from Draw
-
- ---Purpose: Provides an encapsulation of the TCL interpretor
- -- to define Draw commands.
-
-uses
-
- SStream from Standard,
- PInterp from Draw,
- CommandFunction from Draw,
- AsciiString from TCollection,
- ExtendedString from TCollection
-
-is
-
- Create returns Interpretor from Draw;
-
- Init(me : in out);
-
- Add(me : in out; Command : CString;
- Help : CString;
- Function : CommandFunction from Draw;
- Group : CString = "User Commands");
- ---Purpose: Creates a new command with name <Command>, help
- -- string <Help> in group <Group>.
- -- <Function> implement the function.
-
- Add(me : in out; Command : CString;
- Help : CString;
- FileName : CString ;
- Function : CommandFunction from Draw;
- Group : CString = "User Commands");
- ---Purpose: Creates a new command with name <Command>, help
- -- string <Help> in group <Group>. <Function>
- -- implement the function.
- -- <FileName> is the name of the file that contains
- -- the implementation of the command
- --
-
- Remove(me : in out; Command : CString)
- returns Boolean;
- ---Purpose: Removes <Command>, returns true if success (the
- -- command existed).
-
- --
- -- The result
- --
-
- Result(me) returns CString;
-
- Reset(me : in out);
- ---Purpose: Resets the result to empty string
-
- Append(me : in out; Result : CString) returns Interpretor from Draw;
- ---Purpose: Appends to the result
- ---C++: return &
- ---C++: alias operator<<
-
- Append(me : in out; Result : AsciiString from TCollection)
- returns Interpretor from Draw;
- ---Purpose: Appends to the result
- ---C++: return &
- ---C++: alias operator<<
-
- Append(me : in out; Result : ExtendedString from TCollection)
- returns Interpretor from Draw;
- ---Purpose: Appends to the result
- ---C++: return &
- ---C++: alias operator<<
-
- Append(me : in out; Result : Integer) returns Interpretor from Draw;
- ---Purpose: Appends to the result
- ---C++: return &
- ---C++: alias operator<<
-
- Append(me : in out; Result : Real) returns Interpretor from Draw;
- ---Purpose: Appends to the result
- ---C++: return &
- ---C++: alias operator<<
-
- Append(me : in out; Result : SStream) returns Interpretor from Draw;
- ---Purpose: Appends to the result
- ---C++: return &
- ---C++: alias operator<<
-
- AppendElement(me : in out; Result : CString);
- ---Purpose: Appends to the result the string as a list element
-
-
-
- --
- -- Interpetation
- --
-
- Eval(me : in out; Script : CString)
- returns Integer;
- ---Purpose: Eval the script and returns OK = 0, ERROR = 1
-
- RecordAndEval(me : in out; Script : CString; Flags : Integer = 0)
- returns Integer;
- ---Purpose: Eval the script and returns OK = 0, ERROR = 1
- -- Store the script in the history record.
-
- EvalFile(me : in out; FileName : CString)
- returns Integer;
- ---Purpose: Eval the content on the file and returns status
-
- Complete(myclass; Script : CString) returns Boolean;
- ---Purpose: Returns True if the script is complete, no pending
- -- closing braces. (})
-
- Destroy(me : in out);
- ---C++: alias ~
-
- --
- -- Access to Tcl_Interp
- --
-
- Create(anInterp : PInterp from Draw)
- returns Interpretor from Draw;
-
- Set(me : in out; anInterp : PInterp from Draw);
-
- Interp (me) returns PInterp from Draw;
-
- SetDoLog (me: in out; doLog: Boolean);
- ---Purpose: Enables or disables logging of all commands and their
- -- results
- ---Level: Advanced
-
- SetDoEcho (me: in out; doEcho: Boolean);
- ---Purpose: Enables or disables eachoing of all commands and their
- -- results to cout
- ---Level: Advanced
-
- GetDoLog (me) returns Boolean;
- ---Purpose: Returns true if logging of commands is enabled
- ---Level: Advanced
-
- GetDoEcho (me) returns Boolean;
- ---Purpose: Returns true if echoing of commands is enabled
- ---Level: Advanced
-
- Log (me: in out) returns SStream;
- ---Purpose: Returns log stream
- ---Level: Advanced
- ---C++: return &
-
- fields
-
- isAllocated : Boolean from Standard;
- myInterp : PInterp from Draw;
-
- myDoLog: Boolean;
- myDoEcho: Boolean;
- myLog: SStream from Standard;
-
-end Interpretor;
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
-#include <Draw_Interpretor.ixx>
+#include <Draw_Interpretor.hxx>
#include <Draw_Appli.hxx>
#include <Standard_SStream.hxx>
#include <Standard_RangeError.hxx>
char **Argv;
};
-
-//
-// Call backs for TCL
-//
-
-struct CData {
- CData(Draw_CommandFunction ff, Draw_Interpretor* ii) : f(ff), i(ii) {}
- Draw_CommandFunction f;
- Draw_Interpretor* i;
-};
-
// logging helpers
namespace {
void dumpArgs (Standard_OStream& os, int argc, const char *argv[])
// MKV 29.03.05
#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
static Standard_Integer CommandCmd
-(ClientData clientData, Tcl_Interp *interp,
+(ClientData theClientData, Tcl_Interp *interp,
Standard_Integer argc, const char* argv[])
#else
static Standard_Integer CommandCmd
-(ClientData clientData, Tcl_Interp *interp,
+(ClientData theClientData, Tcl_Interp *interp,
Standard_Integer argc, char* argv[])
#endif
{
static Standard_Integer code;
code = TCL_OK;
- CData* C = (CData*) clientData;
- Draw_Interpretor& di = *(C->i);
+ Draw_Interpretor::CallBackData* aCallback = (Draw_Interpretor::CallBackData* )theClientData;
+ Draw_Interpretor& di = *(aCallback->myDI);
// log command execution, except commands manipulating log itself and echo
Standard_Boolean isLogManipulation = (strcmp (argv[0], "dlog") == 0 ||
// OCC63: Convert strings from UTF-8 to local encoding, normally expected by OCC commands
TclUTFToLocalStringSentry anArgs ( argc, (const char**)argv );
- Standard_Integer fres = C->f ( di, argc, anArgs.GetArgv() );
+ Standard_Integer fres = aCallback->Invoke ( di, argc, anArgs.GetArgv() );
if (fres != 0)
code = TCL_ERROR;
}
return code;
}
-
-static void CommandDelete (ClientData clientData)
+static void CommandDelete (ClientData theClientData)
{
- CData *C = (CData*) clientData;
- delete C;
+ Draw_Interpretor::CallBackData* aCallback = (Draw_Interpretor::CallBackData* )theClientData;
+ delete aCallback;
}
//=======================================================================
}
//=======================================================================
-//function : Add
-//purpose :
+//function : add
+//purpose :
//=======================================================================
-//#ifdef WNT
-void Draw_Interpretor::Add(const Standard_CString n,
- const Standard_CString help,
- const Draw_CommandFunction f,
- const Standard_CString group)
-//#else
-//void Draw_Interpretor::Add(const Standard_CString n,
-// const Standard_CString help,
-// const Draw_CommandFunction& f,
-// const Standard_CString group)
-//#endif
+void Draw_Interpretor::add (const Standard_CString theCommandName,
+ const Standard_CString theHelp,
+ const Standard_CString theFileName,
+ Draw_Interpretor::CallBackData* theCallback,
+ const Standard_CString theGroup)
{
- Standard_PCharacter pN, pHelp, pGroup;
- //
- pN=(Standard_PCharacter)n;
- pHelp=(Standard_PCharacter)help;
- pGroup=(Standard_PCharacter)group;
- //
- if (myInterp==NULL) Init();
-
- CData* C = new CData(f,this);
-
- Tcl_CreateCommand(myInterp, pN ,CommandCmd, (ClientData) C, CommandDelete);
-
- // add the help
- Tcl_SetVar2(myInterp,"Draw_Helps", pN, pHelp, TCL_GLOBAL_ONLY);
- Tcl_SetVar2(myInterp,"Draw_Groups",pGroup,pN,
- TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
-}
-//=======================================================================
-//function : Add
-//purpose :
-//=======================================================================
-void Draw_Interpretor::Add(const Standard_CString n,
- const Standard_CString help,
- const Standard_CString file_name,
- const Draw_CommandFunction f,
- const Standard_CString group)
-{
- Standard_PCharacter pN, pHelp, pGroup, pFileName;
- //
- pN=(Standard_PCharacter)n;
- pHelp=(Standard_PCharacter)help;
- pGroup=(Standard_PCharacter)group;
- pFileName=(Standard_PCharacter)file_name;
- //
- if (myInterp==NULL) Init();
+ if (myInterp == NULL)
+ {
+ Init();
+ }
- CData* C = new CData(f,this);
- Tcl_CreateCommand(myInterp,pN,CommandCmd, (ClientData) C, CommandDelete);
+ Standard_PCharacter aName = (Standard_PCharacter )theCommandName;
+ Standard_PCharacter aHelp = (Standard_PCharacter )theHelp;
+ Standard_PCharacter aGroup = (Standard_PCharacter )theGroup;
+ Tcl_CreateCommand (myInterp, aName, CommandCmd, (ClientData )theCallback, CommandDelete);
// add the help
- Tcl_SetVar2(myInterp,"Draw_Helps",pN,pHelp,TCL_GLOBAL_ONLY);
- Tcl_SetVar2(myInterp,"Draw_Groups",pGroup,pN,
- TCL_GLOBAL_ONLY|TCL_APPEND_VALUE|TCL_LIST_ELEMENT);
+ Tcl_SetVar2 (myInterp, "Draw_Helps", aName, aHelp, TCL_GLOBAL_ONLY);
+ Tcl_SetVar2 (myInterp, "Draw_Groups", aGroup, aName,
+ TCL_GLOBAL_ONLY | TCL_APPEND_VALUE | TCL_LIST_ELEMENT);
// add path to source file (keep not more than two last subdirectories)
- OSD_Path aPath (pFileName);
+ if (theFileName == NULL
+ || *theFileName == '\0')
+ {
+ return;
+ }
+
+ OSD_Path aPath (theFileName);
Standard_Integer nbTrek = aPath.TrekLength();
- for (Standard_Integer i = 2; i < nbTrek; i++)
+ for (Standard_Integer i = 2; i < nbTrek; ++i)
+ {
aPath.RemoveATrek (1);
- aPath.SetDisk("");
- aPath.SetNode("");
+ }
+ aPath.SetDisk ("");
+ aPath.SetNode ("");
TCollection_AsciiString aSrcPath;
aPath.SystemName (aSrcPath);
- Tcl_SetVar2(myInterp,"Draw_Files",pN,aSrcPath.ToCString(),TCL_GLOBAL_ONLY);
+ Tcl_SetVar2 (myInterp, "Draw_Files", aName, aSrcPath.ToCString(), TCL_GLOBAL_ONLY);
}
-
//=======================================================================
//function : Remove
//purpose :
//purpose :
//=======================================================================
-void Draw_Interpretor::Destroy()
+Draw_Interpretor::~Draw_Interpretor()
{
// MKV 01.02.05
#if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4)))
--- /dev/null
+// Created on: 1995-02-23
+// Created by: Remi LEQUETTE
+// Copyright (c) 1995-1999 Matra Datavision
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and / or modify it
+// under the terms of the GNU Lesser General Public version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#ifndef _Draw_Interpretor_HeaderFile
+#define _Draw_Interpretor_HeaderFile
+
+#include <Standard.hxx>
+#include <Standard_DefineAlloc.hxx>
+#include <Standard_Macro.hxx>
+#include <Standard_Boolean.hxx>
+#include <Draw_PInterp.hxx>
+#include <Standard_SStream.hxx>
+#include <Standard_CString.hxx>
+#include <Standard_Integer.hxx>
+#include <Standard_Real.hxx>
+
+class TCollection_AsciiString;
+class TCollection_ExtendedString;
+
+//! Provides an encapsulation of the TCL interpretor to define Draw commands.
+class Draw_Interpretor
+{
+
+public:
+
+ //! Global callback function definition
+ typedef Standard_Integer (*CommandFunction )(Draw_Interpretor& theDI,
+ Standard_Integer theArgNb,
+ const char** theArgVec);
+
+ //! Callback for TCL (interface)
+ struct CallBackData
+ {
+
+ //! Main constructor
+ CallBackData (Draw_Interpretor* theDI) : myDI (theDI) {}
+
+ //! Destructor
+ virtual ~CallBackData() {}
+
+ //! Invoke function
+ virtual Standard_Integer Invoke (Draw_Interpretor& theDI,
+ Standard_Integer theArgNb,
+ const char** theArgVec) = 0;
+
+ Draw_Interpretor* myDI; //!< pointer to Draw Interpretor
+
+ // make sure allocation and de-allocation is done by the same memory allocator
+ DEFINE_STANDARD_ALLOC
+
+ };
+
+protected:
+
+ //! Callback implementation for global function definition
+ struct CallBackDataFunc : public CallBackData
+ {
+
+ CallBackDataFunc (Draw_Interpretor* theDI,
+ CommandFunction theFunc)
+ : CallBackData (theDI),
+ myFunc (theFunc) {}
+
+ virtual Standard_Integer Invoke (Draw_Interpretor& theDI,
+ Standard_Integer theArgNb,
+ const char** theArgVec)
+ {
+ return myFunc != NULL ? myFunc (theDI, theArgNb, theArgVec) : 1;
+ }
+
+ Draw_Interpretor::CommandFunction myFunc;
+
+ };
+
+ //! Callback implementation for class's method definition
+ template<typename theObjHandle>
+ struct CallBackDataMethod : public CallBackData
+ {
+ typedef typename theObjHandle::element_type element_type;
+ typedef Standard_Integer (element_type::*methodType)(Draw_Interpretor& , Standard_Integer , const char** );
+
+ CallBackDataMethod (Draw_Interpretor* theDI,
+ const theObjHandle& theObjPtr,
+ methodType theMethod)
+ : CallBackData (theDI),
+ myObjPtr (theObjPtr),
+ myMethod (theMethod) {}
+
+ virtual Standard_Integer Invoke (Draw_Interpretor& theDI,
+ Standard_Integer theArgNb,
+ const char** theArgVec)
+ {
+ return myMethod != NULL && !myObjPtr.IsNull()
+ ? (myObjPtr.operator->()->*myMethod) (theDI, theArgNb, theArgVec)
+ : 1;
+ }
+
+ theObjHandle myObjPtr;
+ methodType myMethod;
+
+ };
+
+public:
+
+ //! Empty constructor
+ Standard_EXPORT Draw_Interpretor();
+
+ //! Initialize TCL interpretor
+ Standard_EXPORT void Init();
+
+ //! Creates a new command with name <theCommandName>, help string <theHelp> in group <theGroup>.
+ //! @param theFunction callback implementation
+ inline void Add (Standard_CString theCommandName,
+ Standard_CString theHelp,
+ CommandFunction theFunction,
+ Standard_CString theGroup = "User Commands")
+ {
+ Add (theCommandName, theHelp, "", theFunction, theGroup);
+ }
+
+ //! Creates a new command with name <theCommandName>, help string <theHelp> in group <theGroup>.
+ //! @theFunction callback implementation
+ //! @theFileName the name of the file that contains the implementation of the command
+ inline void Add (Standard_CString theCommandName,
+ Standard_CString theHelp,
+ Standard_CString theFileName,
+ CommandFunction theFunction,
+ Standard_CString theGroup = "User Commands")
+ {
+ CallBackDataFunc* aCallback = new CallBackDataFunc (this, theFunction);
+ add (theCommandName, theHelp, theFileName, aCallback, theGroup);
+ }
+
+ //! Creates a new command with name <theCommandName>, help string <theHelp> in group <theGroup>.
+ //! @param theObjPtr callback class instance
+ //! @param theMethod callback implementation
+ //! @param theFileName the name of the file that contains the implementation of the command
+ template<typename theHandleType>
+ inline void Add (Standard_CString theCommandName,
+ Standard_CString theHelp,
+ Standard_CString theFileName,
+ const theHandleType& theObjPtr,
+ typename Draw_Interpretor::CallBackDataMethod<theHandleType>::methodType theMethod,
+ Standard_CString theGroup)
+ {
+ Draw_Interpretor::CallBackDataMethod<theHandleType>* aCallback =
+ new Draw_Interpretor::CallBackDataMethod<theHandleType> (this, theObjPtr, theMethod);
+ add (theCommandName, theHelp, theFileName, aCallback, theGroup);
+ }
+
+ //! Removes <theCommandName>, returns true if success (the command existed).
+ Standard_EXPORT Standard_Boolean Remove (const Standard_CString theCommandName);
+
+public:
+
+ Standard_EXPORT Standard_CString Result() const;
+
+ //! Resets the result to empty string
+ Standard_EXPORT void Reset();
+
+ //! Appends to the result
+ Standard_EXPORT Draw_Interpretor& Append (const Standard_CString theResult);
+ inline Draw_Interpretor& operator<< (const Standard_CString theResult) { return Append (theResult); }
+
+ //! Appends to the result
+ Standard_EXPORT Draw_Interpretor& Append (const TCollection_AsciiString& theResult);
+ inline Draw_Interpretor& operator<< (const TCollection_AsciiString& theResult) { return Append (theResult); }
+
+ //! Appends to the result
+ Standard_EXPORT Draw_Interpretor& Append (const TCollection_ExtendedString& theResult);
+ inline Draw_Interpretor& operator<< (const TCollection_ExtendedString& theResult) { return Append (theResult); }
+
+ //! Appends to the result
+ Standard_EXPORT Draw_Interpretor& Append (const Standard_Integer theResult);
+ inline Draw_Interpretor& operator<< (const Standard_Integer theResult) { return Append (theResult); }
+
+ //! Appends to the result
+ Standard_EXPORT Draw_Interpretor& Append (const Standard_Real theResult);
+ inline Draw_Interpretor& operator<< (const Standard_Real theResult) { return Append (theResult); }
+
+ //! Appends to the result
+ Standard_EXPORT Draw_Interpretor& Append (const Standard_SStream& theResult);
+ inline Draw_Interpretor& operator<< (const Standard_SStream& theResult) { return Append (theResult); }
+
+ //! Appends to the result the string as a list element
+ Standard_EXPORT void AppendElement (const Standard_CString theResult);
+
+ //! Eval the script and returns OK = 0, ERROR = 1
+ Standard_EXPORT Standard_Integer Eval (const Standard_CString theScript);
+
+ //! Eval the script and returns OK = 0, ERROR = 1
+ //! Store the script in the history record.
+ Standard_EXPORT Standard_Integer RecordAndEval (const Standard_CString theScript,
+ const Standard_Integer theFlags = 0);
+
+ //! Eval the content on the file and returns status
+ Standard_EXPORT Standard_Integer EvalFile (const Standard_CString theFileName);
+
+ //! Returns True if the script is complete, no pending closing braces. (})
+ Standard_EXPORT static Standard_Boolean Complete (const Standard_CString theScript);
+
+public:
+
+ //! Destructor
+ Standard_EXPORT ~Draw_Interpretor();
+
+ Standard_EXPORT Draw_Interpretor (const Draw_PInterp& theInterp);
+
+ Standard_EXPORT void Set (const Draw_PInterp& theInterp);
+
+ Standard_EXPORT Draw_PInterp Interp() const;
+
+ //! Enables or disables logging of all commands and their results
+ Standard_EXPORT void SetDoLog (const Standard_Boolean theDoLog);
+
+ //! Enables or disables eachoing of all commands and their results to cout
+ Standard_EXPORT void SetDoEcho (const Standard_Boolean theDoEcho);
+
+ //! Returns true if logging of commands is enabled
+ Standard_EXPORT Standard_Boolean GetDoLog() const;
+
+ //! Returns true if echoing of commands is enabled
+ Standard_EXPORT Standard_Boolean GetDoEcho() const;
+
+ //! Returns log stream
+ Standard_EXPORT Standard_SStream& Log();
+
+protected:
+
+ Standard_EXPORT void add (Standard_CString theCommandName,
+ Standard_CString theHelp,
+ Standard_CString theFileName,
+ CallBackData* theCallback,
+ Standard_CString theGroup);
+
+private:
+
+ Standard_Boolean isAllocated;
+ Draw_PInterp myInterp;
+ Standard_Boolean myDoLog;
+ Standard_Boolean myDoEcho;
+ Standard_SStream myLog;
+
+public:
+
+ DEFINE_STANDARD_ALLOC
+
+};
+
+#endif // _Draw_Interpretor_HeaderFile
Draw_GraphicCommands.cxx
Draw_UnitCommands.cxx
Draw_Appli.hxx
+Draw_Interpretor.hxx
+Draw_Interpretor.cxx
Draw_Viewer.cxx
Draw_Viewer.hxx
Draw_Viewer.hxx
Draw_Window.cxx
Draw_Window.hxx
Draw_PInterp.hxx
-Draw_CommandFunction.hxx
DrawRessource.h
init.h
MAINWINDOW.h
: Handle_Standard_Transient (thePtr) {}
public:
-
+
+ typedef T element_type;
+
//! Default constructor; creates null handle
NCollection_Handle () {}
#include <BRepPrimAPI_MakeSphere.hxx>
#include <BRepAlgo_Cut.hxx>
#include <NCollection_Map.hxx>
+#include <NCollection_Handle.hxx>
#include <TCollection_HAsciiString.hxx>
#include <Standard_Version.hxx>
return 0;
}
+// Dummy class to test interface for compilation issues
+class QABugs_HandleClass : public Standard_Transient
+{
+public:
+ Standard_Integer HandleProc (Draw_Interpretor& , Standard_Integer , const char** theArgVec)
+ {
+ std::cerr << "QABugs_HandleClass[" << this << "] " << theArgVec[0] << "\n";
+ return 0;
+ }
+ DEFINE_STANDARD_RTTI(QABugs_HandleClass) // Type definition
+};
+DEFINE_STANDARD_HANDLE (QABugs_HandleClass, Standard_Transient)
+IMPLEMENT_STANDARD_HANDLE (QABugs_HandleClass, Standard_Transient)
+IMPLEMENT_STANDARD_RTTIEXT(QABugs_HandleClass, Standard_Transient)
+
+// Dummy class to test interface for compilation issues
+struct QABugs_NHandleClass
+{
+ Standard_Integer NHandleProc (Draw_Interpretor& , Standard_Integer , const char** theArgVec)
+ {
+ std::cerr << "QABugs_NHandleClass[" << this << "] " << "" << theArgVec[0] << "\n";
+ return 0;
+ }
+};
+
void QABugs::Commands_19(Draw_Interpretor& theCommands) {
const char *group = "QABugs";
+ Handle(QABugs_HandleClass) aClassPtr = new QABugs_HandleClass();
+ theCommands.Add ("OCC24202_1", "Test Handle-based procedure",
+ __FILE__, aClassPtr, &QABugs_HandleClass::HandleProc, group);
+ NCollection_Handle<QABugs_NHandleClass> aNClassPtr = new QABugs_NHandleClass();
+ theCommands.Add ("OCC24202_2", "Test NCollection_Handle-based procedure",
+ __FILE__, aNClassPtr, &QABugs_NHandleClass::NHandleProc, group);
+
theCommands.Add ("OCC230", "OCC230 TrimmedCurve Pnt2d Pnt2d", __FILE__, OCC230, group);
theCommands.Add ("OCC142", "OCC142", __FILE__, OCC142, group);
theCommands.Add ("OCC23361", "OCC23361", __FILE__, OCC23361, group);
\
class Handle(C1) : public Handle(C2) { \
public: \
+ typedef C1 element_type;\
+ \
Handle(C1)():Handle(C2)() {} \
\
Handle(C1)(const Handle(C1)& aHandle) : Handle(C2)(aHandle) {} \