1 // Created on: 2002-02-04
2 // Created by: QA Admin
3 // Copyright (c) 2002-2012 OPEN CASCADE SAS
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
26 #include <QADraw_DataMapOfAsciiStringOfAddress.hxx>
27 #include <Draw_Interpretor.hxx>
28 #include <Image_AlienPixMap.hxx>
29 #include <V3d_View.hxx>
30 #include <ViewerTest.hxx>
31 #include <ViewerTest_EventManager.hxx>
32 #include <TColStd_StackOfInteger.hxx>
33 #include <TColStd_ListOfInteger.hxx>
34 #include <TColStd_ListIteratorOfListOfInteger.hxx>
35 #include <TColStd_HSequenceOfReal.hxx>
36 #include <AIS_InteractiveContext.hxx>
38 #include <Draw_Window.hxx>
39 #include <Draw_Viewer.hxx>
40 #include <Aspect_WindowDriver.hxx>
42 #include <Aspect_DisplayConnection.hxx>
43 #include <Graphic3d.hxx>
46 #include <Xw_Window.hxx>
49 #include <X11/Xutil.h>
50 #include <Xw_Cextern.hxx>
54 #include <WNT_Window.hxx>
60 #if ! defined(STDOUT_FILENO)
61 #define STDOUT_FILENO fileno(stdout)
65 #if ! defined(STDERR_FILENO)
66 #define STDERR_FILENO fileno(stderr)
69 Draw_Interpretor *thePCommands = NULL;
72 //extern Draw_Interpretor theCommands;
74 extern void (*Draw_BeforeCommand)();
75 extern void (*Draw_AfterCommand)(Standard_Integer);
77 //Standard_EXPORT Draw_Interpretor theCommands;
79 Standard_EXPORT void (*Draw_BeforeCommand)();
80 Standard_EXPORT void (*Draw_AfterCommand)(Standard_Integer);
84 #include <Draw_PluginMacro.hxx>
86 // avoid warnings on 'extern "C"' functions returning C++ classes
88 #pragma warning(4:4190)
94 void (*Draw_BeforeCommand_old)();
95 void (*Draw_AfterCommand_old)(Standard_Integer);
97 static Standard_Boolean should_be_printed = Standard_True;
99 static Standard_Boolean shouldDUP() {
101 #if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
102 const Standard_Character * adup = Tcl_GetVar(thePCommands->Interp(),
103 "QA_DUP",TCL_GLOBAL_ONLY);
105 Standard_Character * adup = Tcl_GetVar(thePCommands->Interp(),
106 "QA_DUP",TCL_GLOBAL_ONLY);
108 Standard_Integer aDUP=1;
109 if((adup != NULL) && (Draw::Atof(adup) == 0)) {
116 static void before() {
117 should_be_printed = Standard_True;
118 if(Draw_BeforeCommand_old) (*Draw_BeforeCommand_old) ();
121 static void after(Standard_Integer a)
123 if(Draw_AfterCommand_old) (*Draw_AfterCommand_old) (a);
124 if(!should_be_printed) {
125 // Tcl_ResetResult(theCommands.Interp());
129 static QADraw_DataMapOfAsciiStringOfAddress stFuncMap;
132 #if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
133 static Standard_Integer (*CommandCmd_Old)
134 (ClientData clientData, Tcl_Interp *interp,
135 Standard_Integer argc, const char* argv[]) = NULL;
137 static Standard_Integer (*CommandCmd_Old)
138 (ClientData clientData, Tcl_Interp *interp,
139 Standard_Integer argc, char* argv[]) = NULL;
143 #if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
144 static Standard_Integer CommandCmd
145 (ClientData clientData, Tcl_Interp *interp,
146 Standard_Integer argc, const char* argv[])
148 static Standard_Integer CommandCmd
149 (ClientData clientData, Tcl_Interp *interp,
150 Standard_Integer argc, char* argv[])
153 Standard_Integer old_out = 0;
154 Standard_Integer old_err = 0;
155 Standard_Integer fd_out = 0;
156 Standard_Integer fd_err = 0;
158 FILE * aFile_out = NULL;
159 FILE * aFile_err = NULL;
164 if(strlen(getenv("TEMP")) == 0) {
165 cerr << "The TEMP variable is not set." << endl;
166 aFile_out = tmpfile();
167 aFile_err = tmpfile();
169 nameo = _tempnam(getenv("TEMP"),"tmpo");
170 namee = _tempnam(getenv("TEMP"),"tmpe");
171 aFile_out=fopen(nameo, "w+");
172 aFile_err=fopen(namee, "w+");
175 aFile_out = tmpfile();
176 aFile_err = tmpfile();
178 fd_out = fileno(aFile_out);
179 fd_err = fileno(aFile_err);
180 if(fd_out !=-1 && fd_err !=-1) {
181 old_err = dup(STDERR_FILENO);
182 old_out = dup(STDOUT_FILENO);
183 dup2(fd_err,STDERR_FILENO);
184 dup2(fd_out,STDOUT_FILENO);
186 cout << "Faulty : Can not create temporary file." << endl;
188 Standard_Integer clen = sizeof(Standard_Character);
190 Standard_Character * QA = getenv("QA_print_command");
191 if((QA != NULL) && (!strcmp(QA,"1"))) {
192 for(Standard_Integer i=0;i<argc;i++) {
193 write(st_err,argv[i],clen*strlen(argv[i]));
194 write(st_err," ",clen);
196 write(st_err,"\n",clen);
200 #if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
201 TCollection_AsciiString aName((char *) argv[0]);
203 TCollection_AsciiString aName(argv[0]);
206 Standard_Integer res = 0;
208 if(stFuncMap.IsBound(aName)) {
210 #if ((TCL_MAJOR_VERSION > 8) || ((TCL_MAJOR_VERSION == 8) && (TCL_MINOR_VERSION >= 4))) && !defined(USE_NON_CONST)
211 CommandCmd_Old = (int(*)(void*, Tcl_Interp*, int, const char**)) stFuncMap((char *) argv[0]);
213 CommandCmd_Old = (int(*)(void*, Tcl_Interp*, int, char**)) stFuncMap(argv[0]);
215 res = (*CommandCmd_Old) (clientData,interp,argc,argv);
220 close(STDERR_FILENO);
221 close(STDOUT_FILENO);
222 dup2(old_err,STDERR_FILENO);
223 dup2(old_out,STDOUT_FILENO);
227 Standard_Character buf[256];
228 Standard_Integer len = 0;
231 while((len = read(fd_err,buf,clen*255)/clen) > 0) {
234 (*thePCommands) << buf;
236 write(st_err,buf,clen*len);
244 while((len = read(fd_out,buf,clen*255)/clen) > 0) {
247 (*thePCommands) << buf;
249 write(st_err,buf,clen*len);
255 Standard_Character *Result = (Standard_Character *)thePCommands->Result();
256 if(Result[0] != '\0') {
257 Standard_Integer pos = 0;
258 Standard_Integer rlen = strlen(Result);
260 Standard_Integer nb = 256;
261 if((rlen - pos) <= 256) {
264 write(st_err,Result+pos,nb*clen);
267 write(st_err,"\n",clen);
268 should_be_printed = Standard_False ;
278 static Standard_Integer QARebuild (Draw_Interpretor& di, Standard_Integer /*n*/, const char ** a)
281 Tcl_CmdInfo *infoPtr = new Tcl_CmdInfo;
283 if(!strcmp(a[0],a[1]))
286 char* var_a = (char*)a[1];
287 Standard_Integer res = Tcl_GetCommandInfo(di.Interp(),var_a,infoPtr);
288 if(res && (infoPtr->proc != &CommandCmd)) {
289 TCollection_AsciiString aName(var_a);
290 if (!stFuncMap.IsBound(aName)) {
291 stFuncMap.Bind(aName, (Standard_Address) infoPtr->proc);
293 infoPtr->proc = &CommandCmd;
294 #if TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION == 3
295 infoPtr->isNativeObjectProc = 0;
296 infoPtr->objProc = NULL;
298 Tcl_SetCommandInfo(di.Interp(),var_a,infoPtr);
305 Handle(TColStd_HSequenceOfReal) GetColorOfPixel (const Image_PixMap& theImage,
306 const Standard_Integer theCoordinateX,
307 const Standard_Integer theCoordinateY,
308 const Standard_Integer theRadius)
310 Handle(TColStd_HSequenceOfReal) aSeq = new TColStd_HSequenceOfReal();
311 if (theImage.IsEmpty()) {
312 std::cerr << "The image is null.\n";
315 Standard_Integer aWidth = (Standard_Integer )theImage.SizeX();
316 Standard_Integer anHeight = (Standard_Integer )theImage.SizeY();
318 Quantity_Color aColorTmp;
319 for (Standard_Integer anXIter = theCoordinateX - theRadius;
320 anXIter <= theCoordinateX + theRadius; ++anXIter)
322 if (anXIter < 0 || anXIter >= aWidth)
326 for (Standard_Integer anYIter = theCoordinateY - theRadius;
327 anYIter <= theCoordinateY + theRadius; ++anYIter)
329 if (anYIter < 0 || anYIter >= anHeight)
333 // Image_PixMap stores image upside-down in memory!
334 aColorTmp = theImage.PixelColor (anXIter, anYIter);
335 aSeq->Append (aColorTmp.Red());
336 aSeq->Append (aColorTmp.Green());
337 aSeq->Append (aColorTmp.Blue());
343 static Standard_Integer QAAISGetPixelColor (Draw_Interpretor& theDi,
344 Standard_Integer theArgsNb,
345 const char** theArgs)
347 if (theArgsNb != 3 && theArgsNb != 6)
349 theDi << "Usage : " << theArgs[0] << " coordinate_X coordinate_Y [color_R color_G color_B]" << "\n";
350 return 1; // TCL_ERROR
353 Handle(V3d_View) aView3d = ViewerTest::CurrentView();
354 if (aView3d.IsNull())
356 theDi << "You must initialize AISViewer before this command.\n";
357 return 1; // TCL_ERROR
360 const Handle(Aspect_Window) anAISWindow = aView3d->Window();
361 Standard_Integer aWindowSizeX = 0;
362 Standard_Integer aWindowSizeY = 0;
363 anAISWindow->Size (aWindowSizeX, aWindowSizeY);
365 Standard_Integer anArgIter = 1;
366 const Standard_Integer aPickCoordX = Draw::Atoi (theArgs[anArgIter++]);
367 const Standard_Integer aPickCoordY = Draw::Atoi (theArgs[anArgIter++]);
368 const Standard_Integer aRadius = (theArgsNb == 3) ? 0 : 1;
370 Image_ColorRGBF aColorInput = {{ 0.0f, 0.0f, 0.0f }};
373 aColorInput.r() = (Standard_ShortReal )Draw::Atof (theArgs[anArgIter++]);
374 aColorInput.g() = (Standard_ShortReal )Draw::Atof (theArgs[anArgIter++]);
375 aColorInput.b() = (Standard_ShortReal )Draw::Atof (theArgs[anArgIter++]);
378 Image_PixMap anImage;
379 aView3d->ToPixMap (anImage, aWindowSizeX, aWindowSizeY);
380 const Handle(TColStd_HSequenceOfReal) aSeq = GetColorOfPixel (anImage, aPickCoordX, aPickCoordY, aRadius);
381 cout << "Length = " << aSeq->Length() << endl;
383 Image_ColorRGBF aColorPicked = {{ 0.0f, 0.0f, 0.0f }};
384 Standard_Boolean isNotEqual = Standard_True;
385 for (Standard_Integer i = 1; i <= aSeq->Length(); i += 3)
387 aColorPicked.r() = (Standard_ShortReal )aSeq->Value (i + 0);
388 aColorPicked.g() = (Standard_ShortReal )aSeq->Value (i + 1);
389 aColorPicked.b() = (Standard_ShortReal )aSeq->Value (i + 2);
391 if (theArgsNb == 3 ||
392 ((Abs (aColorPicked.r() - aColorInput.r()) <= Precision::Confusion())
393 && (Abs (aColorPicked.g() - aColorInput.g()) <= Precision::Confusion())
394 && (Abs (aColorPicked.b() - aColorInput.b()) <= Precision::Confusion())))
396 isNotEqual = Standard_False;
401 theDi << "RED : " << aColorPicked.r() << " "
402 << "GREEN : " << aColorPicked.g() << " "
403 << "BLUE : " << aColorPicked.b() << "\n";
407 theDi << "User color: \n"
408 << "RED : " << aColorInput.r() << " "
409 << "GREEN : " << aColorInput.g() << " "
410 << "BLUE : " << aColorInput.b() << "\n";
415 theDi << "Faulty : colors are not equal.\n";
416 return 1; // TCL_ERROR
422 extern int ViewerMainLoop (Standard_Integer argc, const char ** argv);
424 Standard_EXPORT int ViewerMainLoop (Standard_Integer argc, const char ** argv);
427 static Standard_Integer QAAISGetMousePoint (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
430 di << "Usage : " << argv[0] << "\n";
433 Handle (V3d_View) QAAISView = ViewerTest::CurrentView ();
434 if ( QAAISView.IsNull () ) {
435 di << "You must initialize AISViewer before this command." << "\n";
438 Standard_Integer QAAISMouseCoordinateX = 0;
439 Standard_Integer QAAISMouseCoordinateY = 0;
440 Standard_Integer argccc = 5;
441 const char *bufff[] = { "A", "B", "C", "D", "E" };
442 const char **argvvv = (const char **) bufff;
443 while ( ViewerMainLoop (argccc, argvvv) ) {
444 ViewerTest::GetMousePosition (QAAISMouseCoordinateX, QAAISMouseCoordinateY);
446 ViewerTest::GetMousePosition (QAAISMouseCoordinateX, QAAISMouseCoordinateY);
447 di << "X-coordinate: " << QAAISMouseCoordinateX << "; Y-coordinate: " << QAAISMouseCoordinateY << "\n";
451 static Standard_Integer QAAISGetColorCoord (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
455 di << "Usage : " << argv[0] << "\n";
458 Handle(Xw_Window) QAAISWindow;
460 Handle (V3d_View) QAAIS_MainView = ViewerTest::CurrentView ();
461 if ( QAAIS_MainView.IsNull () ) {
462 di << "You must initialize AISViewer before this command." << "\n";
465 QAAISWindow = Handle(Xw_Window)::DownCast (QAAIS_MainView->V3d_View::Window());
467 Standard_Integer QAAIS_WindowSize_X = 0;
468 Standard_Integer QAAIS_WindowSize_Y = 0;
469 QAAISWindow->Size(QAAIS_WindowSize_X, QAAIS_WindowSize_Y);
470 Handle(Aspect_DisplayConnection) aDisplayConnection = new Aspect_DisplayConnection();
471 Handle(Graphic3d_GraphicDriver) aGraphicDriver = Graphic3d::InitGraphicDriver (aDisplayConnection);
473 Draw_Window QAAIS_CoordWindow ("coordinate", 421, 205, 200, 60);
474 QAAIS_CoordWindow.DisplayWindow ();
475 QAAIS_CoordWindow.SetColor (12);
477 Handle (Xw_Window) QAAIS_ColorWindow = new Xw_Window (aDisplayConnection, "color", 0.4074, 0.678, 0.1962, 0.06, Quantity_NOC_BLACK);
478 Handle (V3d_Viewer) QAAIS_ColorViewer = new V3d_Viewer (aGraphicDriver, Standard_ExtString ("COLOR"));
479 Handle (V3d_View) QAAIS_ColorView = QAAIS_ColorViewer -> CreateView ();
480 QAAIS_ColorWindow -> Map ();
481 QAAIS_ColorView -> SetWindow (QAAIS_ColorWindow);
482 QAAIS_ColorView -> SetBackgroundColor (Quantity_NOC_BLACK);
483 QAAIS_ColorView -> Redraw ();
485 Standard_Integer QAAIS_MousePoint_X = 0;
486 Standard_Integer QAAIS_MousePoint_Y = 0;
487 Standard_Character QAAIS_MousePointX[32];
488 Sprintf (QAAIS_MousePointX, "X : %d", QAAIS_MousePoint_X);
489 Standard_Character QAAIS_MousePointY[32];
490 Sprintf (QAAIS_MousePointY, "Y : %d", QAAIS_MousePoint_Y);
491 Standard_ShortReal QAAIS_ColorRED = 0;
492 Standard_ShortReal QAAIS_ColorGRN = 0;
493 Standard_ShortReal QAAIS_ColorBLU = 0;
494 Quantity_Color QAAIS_ShowingColor;
495 QAAIS_ShowingColor.SetValues (QAAIS_ColorRED, QAAIS_ColorGRN, QAAIS_ColorBLU, Quantity_TOC_RGB);
496 Standard_Integer argccc = 5;
497 const char *bufff[] = { "A", "B", "C", "D", "E" };
498 const char **argvvv = (const char **) bufff;
499 while (ViewerMainLoop (argccc, argvvv)) {
500 Handle(TColStd_HSequenceOfReal) aSeq;
501 Image_PixMap anImage;
503 ViewerTest::GetMousePosition (QAAIS_MousePoint_X, QAAIS_MousePoint_Y);
504 Handle (V3d_View) QAAIS_MainView = ViewerTest::CurrentView();
505 QAAIS_MainView->ToPixMap (anImage, QAAIS_WindowSize_X, QAAIS_WindowSize_Y);
507 aSeq = GetColorOfPixel (anImage, QAAIS_MousePoint_X, QAAIS_MousePoint_Y, 0);
509 QAAIS_ColorRED = aSeq->Value(1);
510 QAAIS_ColorGRN = aSeq->Value(2);
511 QAAIS_ColorBLU = aSeq->Value(3);
512 QAAIS_ShowingColor.SetValues (QAAIS_ColorRED, QAAIS_ColorGRN, QAAIS_ColorBLU, Quantity_TOC_RGB);
513 QAAIS_ColorView -> SetBackgroundColor (QAAIS_ShowingColor);
514 QAAIS_ColorView -> Redraw ();
515 QAAIS_CoordWindow.Clear();
516 Sprintf (QAAIS_MousePointX, "X : %d", QAAIS_MousePoint_X);
517 Sprintf (QAAIS_MousePointY, "Y : %d", QAAIS_MousePoint_Y);
518 QAAIS_CoordWindow.DrawString (30, 35, QAAIS_MousePointX);
519 QAAIS_CoordWindow.DrawString (125, 35, QAAIS_MousePointY);
521 QAAIS_CoordWindow.Destroy ();
526 //==============================================================================
528 //==============================================================================
530 extern Draw_Viewer dout;
531 extern Display* Draw_WindowDisplay;
532 extern Colormap Draw_WindowColorMap;
534 Standard_IMPORT Draw_Viewer dout;
537 //=======================================================================
539 extern ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
540 extern Handle(AIS_InteractiveContext)& TheAISContext();
542 Standard_EXPORT ViewerTest_DoubleMapOfInteractiveAndName& GetMapOfAIS();
543 Standard_EXPORT Handle(AIS_InteractiveContext)& TheAISContext();
545 #include <ViewerTest_DoubleMapOfInteractiveAndName.hxx>
546 #include <AIS_Trihedron.hxx>
547 #include <AIS_Axis.hxx>
548 #include <Geom_Line.hxx>
549 #include <AIS_Line.hxx>
551 //==============================================================================
552 // function : VTrihedronOrigins
554 // purpose : draws triheron axis origin lines.
555 // Draw arg : vtri_orig trihedron_name
556 //==============================================================================
557 static int VTrihedronOrigins(Draw_Interpretor& di,
558 Standard_Integer argc,
562 di <<"Usage : vtri_orig tri_name"<<"\n";
566 if(TheAISContext().IsNull()){
567 di<<"Make 'vinit' before this method call"<<"\n";
571 //get trihedron from AIS map.
572 TCollection_AsciiString aName(argv[1]);
573 if(!GetMapOfAIS().IsBound2(aName)){
574 di<<"No object named '"<<argv[1]<<"'"<<"\n";
578 Handle(AIS_Trihedron) aTrih =
579 Handle(AIS_Trihedron)::DownCast(GetMapOfAIS().Find2(aName));
581 di<<"Trihedron is not found, try another name"<<"\n";
586 Handle(AIS_Axis) XAxis = aTrih->XAxis();
587 Handle(AIS_Axis) YAxis = aTrih->YAxis();
588 Handle(AIS_Axis) ZAxis = aTrih->Axis();
590 //get geometrical lines
591 Handle(Geom_Line) XGLine = XAxis->Component();
592 Handle(Geom_Line) YGLine = YAxis->Component();
593 Handle(Geom_Line) ZGLine = ZAxis->Component();
596 Handle(AIS_Line) XLine = new AIS_Line(XGLine);
597 Handle(AIS_Line) YLine = new AIS_Line(YGLine);
598 Handle(AIS_Line) ZLine = new AIS_Line(ZGLine);
600 //put them into AIS map:
601 GetMapOfAIS().Bind(XLine,aName+"_X");
602 GetMapOfAIS().Bind(YLine,aName+"_Y");
603 GetMapOfAIS().Bind(ZLine,aName+"_Z");
604 //print names of created objects:
605 di<<argv[1]<<"_X "<<argv[1]<<"_Y "<<argv[1]<<"_Z"<<"\n";
608 TheAISContext()->Display(XLine);
609 TheAISContext()->Display(YLine);
610 TheAISContext()->Display(ZLine);
615 #include <Draw_Viewer.hxx>
618 static Standard_Integer ViewId(const Standard_CString a)
620 Standard_Integer id = Draw::Atoi(a);
621 if ((id < 0) || (id >= MAXVIEW)) {
622 cout << "Incorrect view-id, must be in 0.."<<MAXVIEW-1<<endl;
625 if (!dout.HasView(id)) {
626 cout <<"View "<<id<<" does not exist."<<endl;
632 #include <Draw_Display.hxx>
634 //=======================================================================
636 //=======================================================================
638 static Standard_Integer QArename(Draw_Interpretor& di, Standard_Integer n, const char** a)
641 Standard_Boolean cop = !strcasecmp(a[0],"copy");
643 Handle(Draw_Drawable3D) D;
644 for (Standard_Integer i = 1; i < n; i += 2) {
645 if (i+1 >= n) return 0;
652 Draw::Set(a[i],Handle(Draw_Drawable3D()));
661 //#include <AIS2D_InteractiveContext.hxx>
662 //static Standard_Integer QANbSelected2d (Draw_Interpretor& /*di*/, Standard_Integer argc, char** argv)
665 // cout << "Usage : " << argv[0] << endl;
668 // Handle(AIS2D_InteractiveContext) aContext = Viewer2dTest::GetAIS2DContext();
669 // if(aContext.IsNull()) {
670 // cerr << "use 'v2dinit' command before " << argv[0] << endl;
673 // cout << aContext->NbSelected() << endl;
678 void QADraw::CommonCommands(Draw_Interpretor& theCommands)
680 ios::sync_with_stdio();
682 st_err = dup(STDERR_FILENO);
684 Draw_BeforeCommand_old = Draw_BeforeCommand;
685 Draw_AfterCommand_old = Draw_AfterCommand;
687 Draw_BeforeCommand = &before;
688 Draw_AfterCommand = &after;
690 const char* group = "QA_Commands";
692 theCommands.Add("QARebuild","QARebuild command_name",__FILE__,QARebuild,group);
693 theCommands.Add("QAGetPixelColor", "QAGetPixelColor coordinate_X coordinate_Y [color_R color_G color_B]", __FILE__,QAAISGetPixelColor, group);
694 theCommands.Add("QAGetMousePoint", "QAGetMousePoint", __FILE__,QAAISGetMousePoint, group);
695 theCommands.Add("QAGetColorCoord", "QAGetColorCoord", __FILE__,QAAISGetColorCoord, group);
696 theCommands.Add("vtri_orig",
697 "vtri_orig : vtri_orig trihedron_name - draws axis origin lines",
698 __FILE__,VTrihedronOrigins,group);
700 // adding commands "rename" leads to the fact that QA commands doesn't work properly OCC23410, use function "renamevar"
701 // theCommands.Add("rename","rename name1 toname1 name2 toname2 ...",__FILE__,QArename,group);
704 extern "C" int Tkqadraw_Init(Tcl_Interp *);
706 int Tkqadraw_Init(Tcl_Interp * ) {
708 ios::sync_with_stdio();
710 QADraw::CommonCommands(theCommands);
711 QADraw::AdditionalCommands(theCommands);
713 ViewerTest::Commands (theCommands);
714 ViewerTest::ViewerCommands (theCommands);
716 Viewer2dTest::Commands(theCommands);
717 // if (Tcl_PkgProvide(theCommands.Interp(), "Qa", "1.0") != TCL_OK) {
724 //==============================================================================
726 //==============================================================================
727 void QADraw::Factory(Draw_Interpretor& theCommands)
729 thePCommands = &theCommands;
731 // definition of QA Command
732 QADraw::CommonCommands(theCommands);
733 QADraw::AdditionalCommands(theCommands);
735 //ViewerTest::Commands (theCommands);
736 //ViewerTest::ViewerCommands (theCommands);
739 // Viewer2dTest::Commands(theCommands);
743 // cout << "Draw Plugin : QA commands are loaded" << endl;
747 // Declare entry point PLUGINFACTORY