1 // Created on: 2002-05-21
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.
24 #include <Draw_Interpretor.hxx>
26 #include <DrawTrSurf.hxx>
27 #include <AIS_InteractiveContext.hxx>
28 #include <ViewerTest.hxx>
29 #include <AIS_Shape.hxx>
30 #include <TopoDS_Shape.hxx>
32 #include <gp_Pnt2d.hxx>
34 #include <GCE2d_MakeSegment.hxx>
35 #include <Geom2d_TrimmedCurve.hxx>
36 #include <DrawTrSurf.hxx>
38 #include <Precision.hxx>
40 #include <PCollection_HAsciiString.hxx>
42 //static Standard_Integer OCC230 (Draw_Interpretor& /*di*/, Standard_Integer /*argc*/, const char ** /*argv*/)
43 static Standard_Integer OCC230 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv)
46 di << "ERROR OCC230: Usage : " << argv[0] << " TrimmedCurve Pnt2d Pnt2d" << "\n";
51 if ( !DrawTrSurf::GetPoint2d(argv[2],P1)) {
52 di << "ERROR OCC230: " << argv[2] << " is not Pnt2d" << "\n";
55 if ( !DrawTrSurf::GetPoint2d(argv[3],P2)) {
56 di << "ERROR OCC230: " << argv[3] << " is not Pnt2d" << "\n";
60 GCE2d_MakeSegment MakeSegment(P1,P2);
61 Handle(Geom2d_TrimmedCurve) TrimmedCurve = MakeSegment.Value();
62 DrawTrSurf::Set(argv[1], TrimmedCurve);
66 static Standard_Integer OCC142 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** /*argv*/)
68 for(Standard_Integer i= 0;i <= 20;i++){
69 Handle(PCollection_HAsciiString) pstr = new PCollection_HAsciiString("TEST");
72 di << "OCC142: OK" << "\n";
76 static Standard_Integer OCC23361 (Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** /*argv*/)
81 t1.SetRotation(gp_Ax1(p, gp_Dir(0, 1, 0)), -0.49328285294022267);
82 t2.SetRotation(gp_Ax1(p, gp_Dir(0, 0, 1)), 0.87538474718473880);
84 gp_Trsf tComp = t2 * t1;
87 gp_Pnt p2 = p1.Transformed(tComp);
88 gp_Pnt p3 = p1.Transformed(t1);
91 // points must be equal
92 if ( ! p2.IsEqual(p3, Precision::Confusion()) )
93 di << "ERROR OCC23361: equivalent transformations does not produce equal points" << "\n";
95 di << "OCC23361: OK" << "\n";
100 void QABugs::Commands_19(Draw_Interpretor& theCommands) {
101 char *group = "QABugs";
103 theCommands.Add ("OCC230", "OCC230 TrimmedCurve Pnt2d Pnt2d", __FILE__, OCC230, group);
104 theCommands.Add ("OCC142", "OCC142", __FILE__, OCC142, group);
105 theCommands.Add ("OCC23361", "OCC23361", __FILE__, OCC23361, group);