// and conditions governing the rights and limitations under the License.
-#if defined(WOKC40)
-#define V2D
-#define Viewer2dTest QAViewer2dTest
-#endif
-
#include <QABugs.hxx>
#include <Draw_Interpretor.hxx>
#include <CDF.hxx>
#include <Resource_Manager.hxx>
-
-#if defined(WOKC40)
-#include <QAViewer2dTest.hxx>
-#else
-#include <Viewer2dTest.hxx>
-#endif
-
-#include <V2d_View.hxx>
-#include <AIS2D_InteractiveObject.hxx>
-#include <Graphic2d_SetOfMarkers.hxx>
-#include <AIS2D.hxx>
-#include <AIS2D_InteractiveContext.hxx>
-#include <V2d_Viewer.hxx>
-
#include <TopoDS_Wire.hxx>
#include <BRepTools_WireExplorer.hxx>
#include <TopoDS_Vertex.hxx>
return ret;
}
-
static Standard_Integer BUC60851 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** /*argv*/)
{
Handle(AIS_InteractiveContext) context= ViewerTest_Tool::MakeContext ("buc60851");
return 0;
}
-static Standard_Integer OCC402bug (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-{
- Handle(AIS2D_InteractiveContext) aContext = Viewer2dTest::GetAIS2DContext();
- if(aContext.IsNull()) {
- di << "ERROR: Use 'v2dinit' command before " << argv[0] << "\n";
- return 1;
- }
-
- if ( !(argc == 7 || argc == 8) ) {
- di << "ERROR : Usage : " << argv[0] << " IndexMarker>0 TypeOfDetection=0/1/2/3/4 X Y Width Height [Angle=0.0]" << "\n";
- return 1;
- }
-
- Standard_Integer IndexMarker = atoi(argv[1]);
- if (IndexMarker <= 0) {
- di << "ERROR : IndexMarker>0" << "\n";
- return 1;
- }
-
- Standard_Integer TypeOfDetectionInteger = atoi(argv[2]);
- AIS2D_TypeOfDetection TypeOfDetection;
- switch (TypeOfDetectionInteger) {
- case 0:
- case 1:
- case 2:
- case 3:
- case 4:
- TypeOfDetection = (AIS2D_TypeOfDetection) TypeOfDetectionInteger;
- break;
- default:
- di << "ERROR : TypeOfDetection=0/1/2/3/4" << "\n";
- return 1;
- }
-
- Quantity_Length X = atof(argv[3]);
- Quantity_Length Y = atof(argv[4]);
- Quantity_Length Width = atof(argv[5]);
- Quantity_Length Height = atof(argv[6]);
- Quantity_PlaneAngle PlaneAngle;
- if ( argc == 7) {
- PlaneAngle = 0.0;
- } else {
- PlaneAngle = atof(argv[7]);
- }
-
- Handle(V2d_View) View = Viewer2dTest::CurrentView();
- //Handle(V2d_Viewer) aViewer = ViewerTest::GetViewerFromContext();
-
- Handle(AIS2D_InteractiveObject) obj = new AIS2D_InteractiveObject();
- Handle(Graphic2d_SetOfMarkers) markers = new Graphic2d_SetOfMarkers( obj );
-
- markers->Add(IndexMarker, X, Y, Width, Height, PlaneAngle);
-
- aContext->Display( obj, Standard_False );
- obj->SetHighlightMode( TypeOfDetection );
- //aContext->SetDetectionMode( TypeOfDetection );
-
- View->Fitall();
-
- return 0;
-}
-
static Standard_Real delta_percent (Standard_Real a, Standard_Real b)
{
Standard_Real result;
return 0;
}
-static Standard_Integer OCC403bug (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-{
- Handle(AIS2D_InteractiveContext) aContext = Viewer2dTest::GetAIS2DContext();
- if(aContext.IsNull()) {
- di << "ERROR: Use 'v2dinit' command before " << argv[0] << "\n";
- return 1;
- }
-
- if ( argc != 3) {
- di << "ERROR : Usage : " << argv[0] << " ColorName1 ColorName2" << "\n";
- return 1;
- }
-
- Standard_Boolean Found;
- Quantity_NameOfColor NameOfColor1 = GetColorFromName(argv[1] ,Found);
- if ( !Found ) {
- di << "ERROR: " << argv[1] << " - color not found" << "\n";
- return 1;
- }
- Quantity_NameOfColor NameOfColor2 = GetColorFromName(argv[2] ,Found);
- if ( !Found ) {
- di << "ERROR: " << argv[2] << " - color not found" << "\n";
- return 1;
- }
-
- Quantity_Color Color1(NameOfColor1);
- Quantity_Color Color2(NameOfColor2);
-
- Handle(V2d_View) View = Viewer2dTest::CurrentView();
- Handle(V2d_Viewer) Viewer = View->Viewer();
- Viewer->SetGridColor(Color1, Color2);
-
- return 0;
-}
-
-static Standard_Integer OCC404bug (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
-{
- Handle(AIS2D_InteractiveContext) aContext = Viewer2dTest::GetAIS2DContext();
- if(aContext.IsNull()) {
- di << "ERROR: Use 'v2dinit' command before " << argv[0] << "\n";
- return 1;
- }
- if ( argc != 4) {
- di << "ERROR : Usage : " << argv[0] << " R G B" << "\n";
- return 1;
- }
-
- Quantity_Parameter R1 = (Quantity_Parameter) atof(argv[1]);
- Quantity_Parameter R2 = (Quantity_Parameter) atof(argv[2]);
- Quantity_Parameter R3 = (Quantity_Parameter) atof(argv[3]);
-
- Quantity_Color Color;
- Color.SetValues(R1, R2, R3, Quantity_TOC_RGB);
-
- Handle(V2d_View) View = Viewer2dTest::CurrentView();
- View->SetBackground(Color);
- View->Update();
-
- return 0;
-}
-
void QABugs::Commands_18(Draw_Interpretor& theCommands) {
const char *group = "QABugs";
theCommands.Add("OCC216", "OCC216", __FILE__, OCC216, group);
theCommands.Add("OCC267", "OCC267 DOC path", __FILE__, OCC267, group);
theCommands.Add("OCC181", "OCC181 FileName path1 path2 verbose=0/1", __FILE__, OCC181, group);
- theCommands.Add("OCC402", "OCC402 TypeOfDetection=0/1/2/3/4 X Y Width Height [Angle=0.0]", __FILE__, OCC402bug, group);
theCommands.Add("OCC367", "OCC367 shape step goodX goodY goodZ percent_tolerance", __FILE__, OCC367, group);
theCommands.Add("OCC71", "OCC71", __FILE__, OCC71bug, group);
- theCommands.Add("OCC403", "OCC403 ColorName1 ColorName2", __FILE__, OCC403bug, group);
- theCommands.Add("OCC404", "OCC404 R G B; Set Background Color", __FILE__, OCC404bug, group);
return;
}