int main(int n, char **p) { Step::RefPtr<ifc2x3::ExpressDataSet> eds ; try { std::cout << "Creating ExpressDataSet" << std::endl; eds = new ifc2x3::ExpressDataSet; } catch (const std::exception& e) { TEST_FAILURE((std::string("Exception : ") + e.what()).c_str()); } TEST_VALIDITY(eds); /////////////////////////////////////////////////////////////////////////////////////////////////////// Step::RefPtr<ifc2x3::IfcElementarySurface> BasisSurface = eds->createIfcPlane(); TEST_VALIDITY(BasisSurface); TEST_ASSERT(BasisSurface->getDim()==0); Step::RefPtr<ifc2x3::IfcDirection> axis = eds->createIfcDirection(); axis->getDirectionRatios().push_back(1); axis->getDirectionRatios().push_back(0); axis->getDirectionRatios().push_back(0); Step::RefPtr<ifc2x3::IfcDirection> RefDirection = eds->createIfcDirection(); RefDirection->getDirectionRatios().push_back(1); RefDirection->getDirectionRatios().push_back(1); RefDirection->getDirectionRatios().push_back(0); Step::RefPtr<ifc2x3::IfcCartesianPoint> Location = eds->createIfcCartesianPoint(); ifc2x3::List_IfcLengthMeasure_1_3 Coordinates; Coordinates.push_back(0); Coordinates.push_back(0); Coordinates.push_back(0); Location->setCoordinates(Coordinates); Step::RefPtr<ifc2x3::IfcAxis2Placement3D> Pos = eds->createIfcAxis2Placement3D(); Pos->setAxis(axis); Pos->setRefDirection(RefDirection); Pos->setLocation(Location); BasisSurface->setPosition(Pos); TEST_ASSERT(BasisSurface->getDim()==3); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// std::cout << std::endl << "Failure : " << failure_results << " Success : " << success_results << std::endl; return failure_results; }
int main(int n, char **p) { Step::RefPtr<ifc2x3::ExpressDataSet> eds ; try { std::cout << "Creating ExpressDataSet" << std::endl; eds = new ifc2x3::ExpressDataSet; } catch (const std::exception& e) { TEST_FAILURE((std::string("Exception : ") + e.what()).c_str()); } TEST_VALIDITY(eds); Step::RefPtr< ifc2x3::IfcSurfaceOfRevolution > SurfaceOfRevolution = eds->createIfcSurfaceOfRevolution(); TEST_VALIDITY(SurfaceOfRevolution); Step::RefPtr<ifc2x3::IfcLine> AxisLine = SurfaceOfRevolution->getAxisLine(); TEST_ASSERT(AxisLine==NULL); Step::RefPtr<ifc2x3::IfcAxis1Placement> Axis = eds->createIfcAxis1Placement(); Step::RefPtr<ifc2x3::IfcDirection> Dir = eds->createIfcDirection(); Dir->getDirectionRatios().push_back(0); Dir->getDirectionRatios().push_back(0); Dir->getDirectionRatios().push_back(0); Axis->setAxis(Dir); Step::RefPtr<ifc2x3::IfcCartesianPoint> Loc = eds->createIfcCartesianPoint(); Loc->getCoordinates().push_back(0); Loc->getCoordinates().push_back(0); Loc->getCoordinates().push_back(0); Axis->setLocation(Loc); SurfaceOfRevolution->setAxisPosition(Axis); //SurfaceOfRevolution->setAngle(90); AxisLine = SurfaceOfRevolution->getAxisLine(); LOG_DEBUG("AxisLine->getPnt()->getCoordinates()[0] = "<<AxisLine->getPnt()->getCoordinates()[0]<<std::endl); TEST_ASSERT(AxisLine->getPnt()->getCoordinates()[0]==0); LOG_DEBUG("AxisLine->getPnt()->getCoordinates()[1] = "<<AxisLine->getPnt()->getCoordinates()[1]<<std::endl); TEST_ASSERT(AxisLine->getPnt()->getCoordinates()[1]==0); LOG_DEBUG("AxisLine->getPnt()->getCoordinates()[2] = "<<AxisLine->getPnt()->getCoordinates()[2]<<std::endl); TEST_ASSERT(AxisLine->getPnt()->getCoordinates()[2]==0); LOG_DEBUG("AxisLine->getDir()->getMagnitude() = "<<AxisLine->getDir()->getMagnitude()<<std::endl); TEST_ASSERT(AxisLine->getDir()->getMagnitude()==1); LOG_DEBUG("AxisLine->getDir()->getOrientation()->getDirectionRatios()[0] = "<<AxisLine->getDir()->getOrientation()->getDirectionRatios()[0]<<std::endl); TEST_ASSERT(AxisLine->getDir()->getOrientation()->getDirectionRatios()[0]==0); LOG_DEBUG("AxisLine->getDir()->getOrientation()->getDirectionRatios()[1] = "<<AxisLine->getDir()->getOrientation()->getDirectionRatios()[1]<<std::endl); TEST_ASSERT(AxisLine->getDir()->getOrientation()->getDirectionRatios()[1]==0); LOG_DEBUG("AxisLine->getDir()->getOrientation()->getDirectionRatios()[2] = "<<AxisLine->getDir()->getOrientation()->getDirectionRatios()[2]<<std::endl); TEST_ASSERT(AxisLine->getDir()->getOrientation()->getDirectionRatios()[2]==1); std::cout << std::endl << "Failure : " << failure_results << " Success : " << success_results << std::endl; return failure_results; }
int main(int n, char **p) { Step::RefPtr<ifc2x3::ExpressDataSet> eds ; try { std::cout << "Creating ExpressDataSet" << std::endl; eds = new ifc2x3::ExpressDataSet; } catch (const std::exception& e) { TEST_FAILURE((std::string("Exception : ") + e.what()).c_str()); } TEST_VALIDITY(eds); Step::RefPtr< ifc2x3::IfcSurfaceOfLinearExtrusion > SurfaceOfLinearExtrusion = eds->createIfcSurfaceOfLinearExtrusion(); TEST_VALIDITY(SurfaceOfLinearExtrusion); Step::RefPtr< ifc2x3::IfcVector > VectorResult = SurfaceOfLinearExtrusion->getExtrusionAxis(); TEST_ASSERT(VectorResult.valid()) Step::RefPtr< ifc2x3::IfcDirection > DirectionResult = VectorResult->getOrientation(); TEST_ASSERT(DirectionResult.valid()==false); TEST_ASSERT(Step::isUnset(VectorResult->getMagnitude())); Step::RefPtr< ifc2x3::IfcDirection > Direction = eds->createIfcDirection(); Direction->getDirectionRatios().push_back(1); Direction->getDirectionRatios().push_back(1); Direction->getDirectionRatios().push_back(1); SurfaceOfLinearExtrusion->setExtrudedDirection(Direction); SurfaceOfLinearExtrusion->setDepth(1); VectorResult = SurfaceOfLinearExtrusion->getExtrusionAxis(); TEST_ASSERT(VectorResult->getOrientation()->getDirectionRatios()[0]==1); TEST_ASSERT(VectorResult->getOrientation()->getDirectionRatios()[1]==1); TEST_ASSERT(VectorResult->getOrientation()->getDirectionRatios()[2]==1); TEST_ASSERT(VectorResult->getMagnitude()==1); std::cout << std::endl << "Failure : " << failure_results << " Success : " << success_results << std::endl; return failure_results; }
int main(int n, char **p) { Step::RefPtr<ifc2x3::ExpressDataSet> eds ; try { std::cout << "Creating ExpressDataSet" << std::endl; eds = new ifc2x3::ExpressDataSet; } catch (const std::exception& e) { TEST_FAILURE((std::string("Exception : ") + e.what()).c_str()); } TEST_VALIDITY(eds); Step::RefPtr<ifc2x3::IfcDirection> Direction = eds->createIfcDirection(); TEST_VALIDITY(Direction); LOG_DEBUG("Direction->getDim() = " <<Direction->getDim()<< std::endl); TEST_ASSERT(Direction->getDim()==0); Direction->getDirectionRatios().push_back(1); LOG_DEBUG("Direction->getDim() = " <<Direction->getDim()<< std::endl); TEST_ASSERT(Direction->getDim()==1); Direction->getDirectionRatios().push_back(2); LOG_DEBUG("Direction->getDim() = " <<Direction->getDim()<< std::endl); TEST_ASSERT(Direction->getDim()==2); Direction->getDirectionRatios().push_back(3); LOG_DEBUG("Direction->getDim() = " <<Direction->getDim()<< std::endl); TEST_ASSERT(Direction->getDim()==3); std::cout << std::endl << "Failure : " << failure_results << " Success : " << success_results << std::endl; return failure_results; }
int main(int n, char **p) { Step::RefPtr<ifc2x3::ExpressDataSet> eds ; try { std::cout << "Creating ExpressDataSet" << std::endl; eds = new ifc2x3::ExpressDataSet; } catch (const std::exception& e) { TEST_FAILURE((std::string("Exception : ") + e.what()).c_str()); } TEST_VALIDITY(eds); /////////////////////////////////////////////////////////////////////////////////////////// LOG_DEBUG("Test with a IfcBoundedCurve" << std::endl); Step::RefPtr<ifc2x3::IfcBSplineCurve> BSpline = eds->createIfcBezierCurve(); TEST_VALIDITY(BSpline); TEST_ASSERT(BSpline->getDim()==0); ifc2x3::Array_IfcCartesianPoint_0_255 ControlPoint = BSpline->getControlPoints(); Step::Integer IndexOnControlPoints = BSpline->getUpperIndexOnControlPoints(); TEST_ASSERT(ControlPoint.size()==256); TEST_ASSERT(IndexOnControlPoints==0); ifc2x3::List_IfcLengthMeasure_1_3 Coordinates1; Coordinates1.push_back(1); Coordinates1.push_back(1); Coordinates1.push_back(0); Step::RefPtr< ifc2x3::IfcCartesianPoint > Point1 = eds->createIfcCartesianPoint(); Point1->setCoordinates(Coordinates1); ifc2x3::List_IfcCartesianPoint_2_n ListOfIfcCartesianPoint; ListOfIfcCartesianPoint.push_back(Point1); BSpline->setControlPointsList(ListOfIfcCartesianPoint); LOG_DEBUG("BSpline->getDim() = " << BSpline->getDim() << std::endl); TEST_ASSERT(BSpline->getDim()==3); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// LOG_DEBUG("Test with a IfcConic" << std::endl); Step::RefPtr<ifc2x3::IfcConic> Circle = eds->createIfcCircle(); TEST_VALIDITY(Circle); TEST_ASSERT(Circle->getDim()==0); ifc2x3::List_IfcLengthMeasure_1_3 CoordinatesAxis22D; CoordinatesAxis22D.push_back(0); CoordinatesAxis22D.push_back(0); Step::RefPtr< ifc2x3::IfcCartesianPoint > Location1 = eds->createIfcCartesianPoint(); Location1->setCoordinates(CoordinatesAxis22D); Step::RefPtr<ifc2x3::IfcDirection> RefDirection1 = eds->createIfcDirection(); RefDirection1->getDirectionRatios().push_back(1.0); RefDirection1->getDirectionRatios().push_back(1.0); Step::RefPtr< ifc2x3::IfcAxis2Placement > Axis2Placement1 = new ifc2x3::IfcAxis2Placement(); Step::RefPtr< ifc2x3::IfcAxis2Placement2D > Axis2Placement2D1 = eds->createIfcAxis2Placement2D(); Axis2Placement2D1->setLocation(Location1); Axis2Placement2D1->setRefDirection(RefDirection1); Axis2Placement1->setIfcAxis2Placement2D(Axis2Placement2D1.get()); Circle->setPosition(Axis2Placement1); TEST_ASSERT(Circle->getDim()==2); ifc2x3::List_IfcLengthMeasure_1_3 CoordinatesAxis23D; CoordinatesAxis23D.push_back(0); CoordinatesAxis23D.push_back(0); CoordinatesAxis23D.push_back(0); Step::RefPtr< ifc2x3::IfcCartesianPoint > Location2 = eds->createIfcCartesianPoint(); Location2->setCoordinates(CoordinatesAxis23D); Step::RefPtr<ifc2x3::IfcDirection> RefDirection2 = eds->createIfcDirection(); RefDirection2->getDirectionRatios().push_back(1.0); RefDirection2->getDirectionRatios().push_back(1.0); RefDirection2->getDirectionRatios().push_back(1.0); Step::RefPtr< ifc2x3::IfcAxis2Placement > Axis2Placement2 = new ifc2x3::IfcAxis2Placement(); Step::RefPtr< ifc2x3::IfcAxis2Placement3D > Axis2Placement3D1 = eds->createIfcAxis2Placement3D(); Axis2Placement3D1->setLocation(Location2); Axis2Placement3D1->setRefDirection(RefDirection2); Axis2Placement2->setIfcAxis2Placement3D(Axis2Placement3D1.get()); Circle->setPosition(Axis2Placement2); TEST_ASSERT(Circle->getDim()==3); Step::RefPtr<ifc2x3::IfcConic> Ellipse = eds->createIfcEllipse(); TEST_VALIDITY(Ellipse); TEST_ASSERT(Ellipse->getDim()==0); ifc2x3::List_IfcLengthMeasure_1_3 CoordinatesAxis22D1; CoordinatesAxis22D1.push_back(0); CoordinatesAxis22D1.push_back(0); Step::RefPtr< ifc2x3::IfcCartesianPoint > Location3 = eds->createIfcCartesianPoint(); Location3->setCoordinates(CoordinatesAxis22D1); Step::RefPtr<ifc2x3::IfcDirection> RefDirection3 = eds->createIfcDirection(); RefDirection3->getDirectionRatios().push_back(1.0); RefDirection3->getDirectionRatios().push_back(1.0); Step::RefPtr< ifc2x3::IfcAxis2Placement > Axis2Placement3 = new ifc2x3::IfcAxis2Placement(); Step::RefPtr< ifc2x3::IfcAxis2Placement2D > Axis2Placement2D2 = eds->createIfcAxis2Placement2D(); Axis2Placement2D2->setLocation(Location3); Axis2Placement2D2->setRefDirection(RefDirection3); Axis2Placement3->setIfcAxis2Placement2D(Axis2Placement2D2.get()); Ellipse->setPosition(Axis2Placement3); TEST_ASSERT(Ellipse->getDim()==2); ifc2x3::List_IfcLengthMeasure_1_3 CoordinatesAxis23D1; CoordinatesAxis23D1.push_back(0); CoordinatesAxis23D1.push_back(0); CoordinatesAxis23D1.push_back(0); Step::RefPtr< ifc2x3::IfcCartesianPoint > Location4 = eds->createIfcCartesianPoint(); Location4->setCoordinates(CoordinatesAxis23D1); Step::RefPtr<ifc2x3::IfcDirection> RefDirection4 = eds->createIfcDirection(); RefDirection4->getDirectionRatios().push_back(1.0); RefDirection4->getDirectionRatios().push_back(1.0); RefDirection4->getDirectionRatios().push_back(1.0); Step::RefPtr< ifc2x3::IfcAxis2Placement > Axis2Placement4 = new ifc2x3::IfcAxis2Placement(); Step::RefPtr< ifc2x3::IfcAxis2Placement3D > Axis2Placement3D2 = eds->createIfcAxis2Placement3D(); Axis2Placement3D2->setLocation(Location4); Axis2Placement3D2->setRefDirection(RefDirection2); Axis2Placement4->setIfcAxis2Placement3D(Axis2Placement3D2.get()); Ellipse->setPosition(Axis2Placement4); TEST_ASSERT(Ellipse->getDim()==3); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// LOG_DEBUG("Test with a IfcLine" << std::endl); Step::RefPtr<ifc2x3::IfcLine> Line = eds->createIfcLine(); TEST_VALIDITY(Line); TEST_ASSERT(Line->getDim()==0); Step::RefPtr< ifc2x3::IfcCartesianPoint > CartesianPoint1 = eds->createIfcCartesianPoint(); ifc2x3::List_IfcLengthMeasure_1_3 LPoint1; #ifdef STEP_CHECK_RANGE try { #endif LPoint1.push_back(0.0); LPoint1.push_back(0.0); #ifdef STEP_CHECK_RANGE } catch(std::out_of_range e) { TEST_FAILURE((std::string("Exception : ") + e.what()).c_str()); } #endif CartesianPoint1->setCoordinates(LPoint1); Line->setPnt(CartesianPoint1); TEST_ASSERT(Line->getDim()==2); Step::RefPtr< ifc2x3::IfcCartesianPoint > CartesianPoint2 = eds->createIfcCartesianPoint(); ifc2x3::List_IfcLengthMeasure_1_3 LPoint2; #ifdef STEP_CHECK_RANGE try { #endif LPoint2.push_back(0.0); LPoint2.push_back(0.0); LPoint2.push_back(0.0); #ifdef STEP_CHECK_RANGE } catch(std::out_of_range e) { TEST_FAILURE((std::string("Exception : ") + e.what()).c_str()); } #endif CartesianPoint2->setCoordinates(LPoint2); Line->setPnt(CartesianPoint2); TEST_ASSERT(Line->getDim()==3); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// LOG_DEBUG("Test with a IfcOffsetCurve2D" << std::endl); Step::RefPtr<ifc2x3::IfcOffsetCurve2D> OffsetCurve2D = eds->createIfcOffsetCurve2D(); TEST_VALIDITY(OffsetCurve2D); TEST_ASSERT(OffsetCurve2D->getDim()==2); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// LOG_DEBUG("Test with a IfcOffsetCurve3D" << std::endl); Step::RefPtr<ifc2x3::IfcOffsetCurve3D> OffsetCurve3D = eds->createIfcOffsetCurve3D(); TEST_VALIDITY(OffsetCurve3D); TEST_ASSERT(OffsetCurve3D->getDim()==3); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// std::cout << std::endl << "Failure : " << failure_results << " Success : " << success_results << std::endl; return failure_results; }
int main(int n, char **p) { Step::RefPtr<ifc2x3::ExpressDataSet> eds ; try { std::cout << "Creating ExpressDataSet" << std::endl; eds = new ifc2x3::ExpressDataSet; } catch (const std::exception& e) { TEST_FAILURE((std::string("Exception : ") + e.what()).c_str()); } TEST_VALIDITY(eds); Step::RefPtr<ifc2x3::IfcRectangularTrimmedSurface> RectangularTrimmedSurface = eds->createIfcRectangularTrimmedSurface(); TEST_VALIDITY(RectangularTrimmedSurface); LOG_DEBUG("RectangularTrimmedSurface->getDim() = "<<RectangularTrimmedSurface->getDim()<<std::endl); TEST_ASSERT(RectangularTrimmedSurface->getDim()==0); ///////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// LOG_DEBUG("Test with CurveBoundedPlane2D"<< std::endl); Step::RefPtr<ifc2x3::IfcCurveBoundedPlane> CurveBoundedPlane1 = eds->createIfcCurveBoundedPlane(); TEST_VALIDITY(CurveBoundedPlane1); Step::RefPtr<ifc2x3::IfcPlane> BasisSurface1 = eds->createIfcPlane(); TEST_VALIDITY(BasisSurface1); Step::RefPtr<ifc2x3::IfcDirection> axis1 = eds->createIfcDirection(); axis1->getDirectionRatios().push_back(1); axis1->getDirectionRatios().push_back(0); Step::RefPtr<ifc2x3::IfcDirection> RefDirection1 = eds->createIfcDirection(); RefDirection1->getDirectionRatios().push_back(1); RefDirection1->getDirectionRatios().push_back(1); Step::RefPtr<ifc2x3::IfcCartesianPoint> Location1 = eds->createIfcCartesianPoint(); ifc2x3::List_IfcLengthMeasure_1_3 Coordinates1; Coordinates1.push_back(0); Coordinates1.push_back(0); Location1->setCoordinates(Coordinates1); Step::RefPtr<ifc2x3::IfcAxis2Placement3D> Pos1 = eds->createIfcAxis2Placement3D(); Pos1->setAxis(axis1); Pos1->setRefDirection(RefDirection1); Pos1->setLocation(Location1); BasisSurface1->setPosition(Pos1); CurveBoundedPlane1->setBasisSurface(BasisSurface1); ////////////////////////////////////////////////////////////////////////////////////// RectangularTrimmedSurface->setBasisSurface(CurveBoundedPlane1); RectangularTrimmedSurface->setU1(1.5); RectangularTrimmedSurface->setV1(2.5); RectangularTrimmedSurface->setU2(3.5); RectangularTrimmedSurface->setV1(4.5); RectangularTrimmedSurface->setUsense(Step::BTrue); RectangularTrimmedSurface->setVsense(Step::BTrue); LOG_DEBUG("RectangularTrimmedSurface->getDim() = "<<RectangularTrimmedSurface->getDim()<<std::endl); TEST_ASSERT(RectangularTrimmedSurface->getDim()==2); /////////////////////////////////////////////////////////////////////////////////////////// LOG_DEBUG("Test with CurveBoundedPlane3D"<< std::endl); Step::RefPtr<ifc2x3::IfcCurveBoundedPlane> CurveBoundedPlane2 = eds->createIfcCurveBoundedPlane(); TEST_VALIDITY(CurveBoundedPlane2); Step::RefPtr<ifc2x3::IfcPlane> BasisSurface2 = eds->createIfcPlane(); TEST_VALIDITY(BasisSurface2); Step::RefPtr<ifc2x3::IfcDirection> axis2 = eds->createIfcDirection(); axis2->getDirectionRatios().push_back(1); axis2->getDirectionRatios().push_back(0); axis2->getDirectionRatios().push_back(0); Step::RefPtr<ifc2x3::IfcDirection> RefDirection2 = eds->createIfcDirection(); RefDirection2->getDirectionRatios().push_back(1); RefDirection2->getDirectionRatios().push_back(1); RefDirection2->getDirectionRatios().push_back(1); Step::RefPtr<ifc2x3::IfcCartesianPoint> Location2 = eds->createIfcCartesianPoint(); ifc2x3::List_IfcLengthMeasure_1_3 Coordinates2; Coordinates2.push_back(0); Coordinates2.push_back(0); Coordinates2.push_back(0); Location2->setCoordinates(Coordinates2); Step::RefPtr<ifc2x3::IfcAxis2Placement3D> Pos2 = eds->createIfcAxis2Placement3D(); Pos2->setAxis(axis2); Pos2->setRefDirection(RefDirection2); Pos2->setLocation(Location2); BasisSurface2->setPosition(Pos2); CurveBoundedPlane2->setBasisSurface(BasisSurface2); ////////////////////////////////////////////////////////////////////////////////////// RectangularTrimmedSurface->setBasisSurface(CurveBoundedPlane2); RectangularTrimmedSurface->setU1(1.5); RectangularTrimmedSurface->setV1(2.5); RectangularTrimmedSurface->setU2(3.5); RectangularTrimmedSurface->setV1(4.5); RectangularTrimmedSurface->setUsense(Step::BTrue); RectangularTrimmedSurface->setVsense(Step::BTrue); LOG_DEBUG("RectangularTrimmedSurface->getDim() = "<<RectangularTrimmedSurface->getDim()<<std::endl); TEST_ASSERT(RectangularTrimmedSurface->getDim()==3); std::cout << std::endl << "Failure : " << failure_results << " Success : " << success_results << std::endl; return failure_results; }
int main(int n, char **p) { Step::RefPtr<ifc2x3::ExpressDataSet> eds ; try { std::cout << "Creating ExpressDa20taSet" << std::endl; eds = new ifc2x3::ExpressDataSet; } catch (const std::exception& e) { TEST_FAILURE((std::string("Exception : ") + e.what()).c_str()); } TEST_VALIDITY(eds); Step::RefPtr<ifc2x3::IfcAxis2Placement2D> placement = eds->createIfcAxis2Placement2D(); // get P with an empty placement to check default values ifc2x3::List_IfcDirection_2_2 P = placement->getP(); TEST_ASSERT(P.size()==2); TEST_VALIDITY(P[0]); TEST_VALIDITY(P[1]); if (P[0].valid() && P[1].valid()) { // test default return value (1,0) TEST_ASSERT(P[0]->getDirectionRatios()[0]==1.0); TEST_ASSERT(P[0]->getDirectionRatios()[1]==0.0); // test default return value (0,1) TEST_ASSERT(P[1]->getDirectionRatios()[0]==0.0); TEST_ASSERT(P[1]->getDirectionRatios()[1]==1.0); } // create a IfcDirection(0,1) to give some information to the placement Step::RefPtr<ifc2x3::IfcDirection> RefDirection = eds->createIfcDirection(); RefDirection->getDirectionRatios().push_back(0.0); RefDirection->getDirectionRatios().push_back(1.0); placement->setRefDirection(RefDirection); P = placement->getP(); TEST_VALIDITY(P[0]); TEST_VALIDITY(P[1]); if (P[0].valid() && P[1].valid()) { TEST_ASSERT(P[0]->getDirectionRatios()[0]==0.0); TEST_ASSERT(P[0]->getDirectionRatios()[1]==1.0); TEST_ASSERT(P[1]->getDirectionRatios()[0]==-1.0); TEST_ASSERT(P[1]->getDirectionRatios()[1]==0.0); } std::cout << std::endl << "Failure : " << failure_results << " Success : " << success_results << std::endl; return failure_results; }
int main(int n, char **p) { Step::RefPtr<ifc2x3::ExpressDataSet> eds ; try { std::cout << "Creating ExpressDataSet" << std::endl; eds = new ifc2x3::ExpressDataSet; } catch (const std::exception& e) { TEST_FAILURE((std::string("Exception : ") + e.what()).c_str()); } TEST_VALIDITY(eds); Step::RefPtr<ifc2x3::IfcCartesianTransformationOperator3D> CTOperator3D = eds->createIfcCartesianTransformationOperator3D(); TEST_VALIDITY(CTOperator3D); /////////////////////////////////////////////////////////////////////////////////// ifc2x3::List_IfcDirection_3_3 ListIfcDirection1 = CTOperator3D->getU(); LOG_DEBUG("Axis1, Axis2 and Axis3 not exist" << std::endl); TEST_ASSERT(ListIfcDirection1[0]->getDirectionRatios()[0]==1.0); TEST_ASSERT(ListIfcDirection1[0]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection1[0]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection1[1]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection1[1]->getDirectionRatios()[1]==1.0); TEST_ASSERT(ListIfcDirection1[1]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection1[2]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection1[2]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection1[2]->getDirectionRatios()[2]==1.0); /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// Step::RefPtr< ifc2x3::IfcDirection > Axis1 = eds->createIfcDirection(); ifc2x3::List_Real_2_3 ListReal1; ListReal1.push_back(1.0); ListReal1.push_back(0.0); ListReal1.push_back(0.0); Axis1->setDirectionRatios(ListReal1); CTOperator3D->setAxis1(Axis1); ifc2x3::List_IfcDirection_3_3 ListIfcDirection2 = CTOperator3D->getU(); LOG_DEBUG("Axis1 [1.0;0.0] and Axis2 not exist" << std::endl); LOG_DEBUG("U[0] = ["<< ListIfcDirection2[0]->getDirectionRatios()[0] << " ; " << ListIfcDirection2[0]->getDirectionRatios()[1] << " ; " << ListIfcDirection2[0]->getDirectionRatios()[2] << "]" << std::endl); LOG_DEBUG("U[1] = ["<< ListIfcDirection2[1]->getDirectionRatios()[0] << " ; " << ListIfcDirection2[1]->getDirectionRatios()[1] << " ; " << ListIfcDirection2[1]->getDirectionRatios()[2] << "]" << std::endl); LOG_DEBUG("U[2] = ["<< ListIfcDirection2[2]->getDirectionRatios()[0] << " ; " << ListIfcDirection2[2]->getDirectionRatios()[1] << " ; " << ListIfcDirection2[2]->getDirectionRatios()[2] << "]" << std::endl); TEST_ASSERT(ListIfcDirection2[0]->getDirectionRatios()[0]==1.0); TEST_ASSERT(ListIfcDirection2[0]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection2[0]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection2[1]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection2[1]->getDirectionRatios()[1]==1.0); TEST_ASSERT(ListIfcDirection2[1]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection2[2]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection2[2]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection2[2]->getDirectionRatios()[2]==1.0); /////////////////////////////////////////////////////////////////////////////////// Step::RefPtr< ifc2x3::IfcDirection > Axis2 = eds->createIfcDirection(); ifc2x3::List_Real_2_3 ListReal2; ListReal2.push_back(0.0); ListReal2.push_back(1.0); ListReal2.push_back(0.0); Axis2->setDirectionRatios(ListReal2); CTOperator3D->setAxis2(Axis2); ifc2x3::List_IfcDirection_3_3 ListIfcDirection3 = CTOperator3D->getU(); LOG_DEBUG("Axis1 [1.0;0.0;0.0] and Axis2[0.0;1.0;0.0]" << std::endl); LOG_DEBUG("U[0] = ["<< ListIfcDirection3[0]->getDirectionRatios()[0] << " ; " << ListIfcDirection3[0]->getDirectionRatios()[1] << " ; " << ListIfcDirection3[0]->getDirectionRatios()[2]<< "]" << std::endl); LOG_DEBUG("U[1] = ["<< ListIfcDirection3[1]->getDirectionRatios()[0] << " ; " << ListIfcDirection3[1]->getDirectionRatios()[1] << " ; " << ListIfcDirection3[1]->getDirectionRatios()[2]<< "]" << std::endl); LOG_DEBUG("U[2] = ["<< ListIfcDirection3[2]->getDirectionRatios()[0] << " ; " << ListIfcDirection3[2]->getDirectionRatios()[1] << " ; " << ListIfcDirection3[2]->getDirectionRatios()[2]<< "]" << std::endl); TEST_ASSERT(ListIfcDirection3[0]->getDirectionRatios()[0]==1.0); TEST_ASSERT(ListIfcDirection3[0]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection3[0]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection3[1]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection3[1]->getDirectionRatios()[1]==1.0); TEST_ASSERT(ListIfcDirection3[1]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection3[2]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection3[2]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection3[2]->getDirectionRatios()[2]==1.0); /////////////////////////////////////////////////////////////////////////////////// Step::RefPtr< ifc2x3::IfcDirection > Axis3 = eds->createIfcDirection(); ifc2x3::List_Real_2_3 ListReal3; ListReal3.push_back(0.0); ListReal3.push_back(0.0); ListReal3.push_back(1.0); Axis3->setDirectionRatios(ListReal3); CTOperator3D->setAxis3(Axis3); ifc2x3::List_IfcDirection_3_3 ListIfcDirection4 = CTOperator3D->getU(); LOG_DEBUG("Axis1 [1.0;0.0;0.0], Axis2[0.0;1.0;0.0] And Axis3[0.0;0.0;1.0] " << std::endl); LOG_DEBUG("U[0] = ["<< ListIfcDirection4[0]->getDirectionRatios()[0] << " ; " << ListIfcDirection4[0]->getDirectionRatios()[1] << " ; " << ListIfcDirection4[0]->getDirectionRatios()[2]<< "]" << std::endl); LOG_DEBUG("U[1] = ["<< ListIfcDirection4[1]->getDirectionRatios()[0] << " ; " << ListIfcDirection4[1]->getDirectionRatios()[1] << " ; " << ListIfcDirection4[1]->getDirectionRatios()[2]<< "]" << std::endl); LOG_DEBUG("U[2] = ["<< ListIfcDirection4[2]->getDirectionRatios()[0] << " ; " << ListIfcDirection4[2]->getDirectionRatios()[1] << " ; " << ListIfcDirection4[2]->getDirectionRatios()[2]<< "]" << std::endl); TEST_ASSERT(ListIfcDirection4[0]->getDirectionRatios()[0]==1.0); TEST_ASSERT(ListIfcDirection4[0]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection4[0]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection4[1]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection4[1]->getDirectionRatios()[1]==1.0); TEST_ASSERT(ListIfcDirection4[1]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection4[2]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection4[2]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection4[2]->getDirectionRatios()[2]==1.0); /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// ifc2x3::List_Real_2_3 ListReal4; ListReal4.push_back(0.0); ListReal4.push_back(0.0); ListReal4.push_back(1.0); Axis1->setDirectionRatios(ListReal4); CTOperator3D->setAxis1(Axis1); ifc2x3::List_IfcDirection_3_3 ListIfcDirection5 = CTOperator3D->getU(); TEST_ASSERT(ListIfcDirection5.empty()); /* LOG_DEBUG("Axis1 [0.0;0.0;1.0], Axis2[0.0;1.0;0.0] And Axis3[0.0;0.0;1.0]" << std::endl); LOG_DEBUG("U[0] = ["<< ListIfcDirection5[0]->getDirectionRatios()[0] << " ; " << ListIfcDirection5[0]->getDirectionRatios()[1] << " ; " << ListIfcDirection5[0]->getDirectionRatios()[2] << "]" << std::endl); LOG_DEBUG("U[1] = ["<< ListIfcDirection5[1]->getDirectionRatios()[0] << " ; " << ListIfcDirection5[1]->getDirectionRatios()[1] << " ; " << ListIfcDirection5[1]->getDirectionRatios()[2] << "]" << std::endl); LOG_DEBUG("U[2] = ["<< ListIfcDirection5[2]->getDirectionRatios()[0] << " ; " << ListIfcDirection5[2]->getDirectionRatios()[1] << " ; " << ListIfcDirection5[2]->getDirectionRatios()[2] << "]" << std::endl); TEST_ASSERT(ListIfcDirection5[0]->getDirectionRatios()[0]==1.0); TEST_ASSERT(ListIfcDirection5[0]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection5[0]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection5[1]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection5[1]->getDirectionRatios()[1]==1.0); TEST_ASSERT(ListIfcDirection5[1]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection5[2]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection5[2]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection5[2]->getDirectionRatios()[2]==1.0); */ /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// ifc2x3::List_Real_2_3 ListReal5; ListReal5.push_back(2.0); ListReal5.push_back(0.0); ListReal5.push_back(0.0); Axis1->setDirectionRatios(ListReal5); CTOperator3D->setAxis1(Axis1); ifc2x3::List_Real_2_3 ListReal6; ListReal6.push_back(0.0); ListReal6.push_back(6.0); ListReal6.push_back(0.0); Axis2->setDirectionRatios(ListReal6); ifc2x3::List_Real_2_3 ListReal7; ListReal7.push_back(0.0); ListReal7.push_back(0.0); ListReal7.push_back(8.0); Axis3->setDirectionRatios(ListReal7); ifc2x3::List_IfcDirection_3_3 ListIfcDirection6 = CTOperator3D->getU(); LOG_DEBUG("Axis1 [2.0;0.0;0.0], Axis2[0.0;6.0;0.0] And Axis3[0.0;0.0;8.0]" << std::endl); LOG_DEBUG("U[0] = ["<< ListIfcDirection6[0]->getDirectionRatios()[0] << " ; " << ListIfcDirection6[0]->getDirectionRatios()[1] << " ; " << ListIfcDirection6[0]->getDirectionRatios()[2] << "]" << std::endl); LOG_DEBUG("U[1] = ["<< ListIfcDirection6[1]->getDirectionRatios()[0] << " ; " << ListIfcDirection6[1]->getDirectionRatios()[1] << " ; " << ListIfcDirection6[1]->getDirectionRatios()[2] << "]" << std::endl); LOG_DEBUG("U[2] = ["<< ListIfcDirection6[2]->getDirectionRatios()[0] << " ; " << ListIfcDirection6[2]->getDirectionRatios()[1] << " ; " << ListIfcDirection6[2]->getDirectionRatios()[2] << "]" << std::endl); TEST_ASSERT(ListIfcDirection6[0]->getDirectionRatios()[0]==1.0); TEST_ASSERT(ListIfcDirection6[0]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection6[0]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection6[1]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection6[1]->getDirectionRatios()[1]==1.0); TEST_ASSERT(ListIfcDirection6[1]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection6[2]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection6[2]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection6[2]->getDirectionRatios()[2]==1.0); /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// ifc2x3::List_Real_2_3 ListReal8; ListReal8.push_back(0.0); ListReal8.push_back(0.0); ListReal8.push_back(5.0); Axis1->setDirectionRatios(ListReal8); CTOperator3D->setAxis1(Axis1); ifc2x3::List_Real_2_3 ListReal9; ListReal9.push_back(-5.0); ListReal9.push_back(0.0); ListReal9.push_back(0.0); Axis2->setDirectionRatios(ListReal9); ifc2x3::List_Real_2_3 ListReal10; ListReal10.push_back(0.0); ListReal10.push_back(-8.0); ListReal10.push_back(0.0); Axis3->setDirectionRatios(ListReal10); ifc2x3::List_IfcDirection_3_3 ListIfcDirection7 = CTOperator3D->getU(); LOG_DEBUG("Axis1 [0.0;0.0;5.0], Axis2[-5.0;0.0;0.0] And Axis3[0.0;-8.0;0.0]" << std::endl); LOG_DEBUG("U[0] = ["<< ListIfcDirection7[0]->getDirectionRatios()[0] << " ; " << ListIfcDirection7[0]->getDirectionRatios()[1] << " ; " << ListIfcDirection7[0]->getDirectionRatios()[2] << "]" << std::endl); LOG_DEBUG("U[1] = ["<< ListIfcDirection7[1]->getDirectionRatios()[0] << " ; " << ListIfcDirection7[1]->getDirectionRatios()[1] << " ; " << ListIfcDirection7[1]->getDirectionRatios()[2] << "]" << std::endl); LOG_DEBUG("U[2] = ["<< ListIfcDirection7[2]->getDirectionRatios()[0] << " ; " << ListIfcDirection7[2]->getDirectionRatios()[1] << " ; " << ListIfcDirection7[2]->getDirectionRatios()[2] << "]" << std::endl); TEST_ASSERT(ListIfcDirection7[0]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection7[0]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection7[0]->getDirectionRatios()[2]==1.0); TEST_ASSERT(ListIfcDirection7[1]->getDirectionRatios()[0]==-1.0); TEST_ASSERT(ListIfcDirection7[1]->getDirectionRatios()[1]==0.0); TEST_ASSERT(ListIfcDirection7[1]->getDirectionRatios()[2]==0.0); TEST_ASSERT(ListIfcDirection7[2]->getDirectionRatios()[0]==0.0); TEST_ASSERT(ListIfcDirection7[2]->getDirectionRatios()[1]==-1.0); TEST_ASSERT(ListIfcDirection7[2]->getDirectionRatios()[2]==0.0); std::cout << std::endl << "Failure : " << failure_results << " Success : " << success_results << std::endl; return failure_results; }
int main(int n, char **p) { Step::RefPtr<ifc2x3::ExpressDataSet> eds ; try { std::cout << "Creating ExpressDataSet" << std::endl; eds = new ifc2x3::ExpressDataSet; } catch (const std::exception& e) { TEST_FAILURE((std::string("Exception : ") + e.what()).c_str()); } TEST_VALIDITY(eds); LOG_DEBUG(std::endl << "Test with no Scale" << std::endl); Step::RefPtr<ifc2x3::IfcCartesianTransformationOperator2DnonUniform> CTOperator2DnonUniform1 = eds->createIfcCartesianTransformationOperator2DnonUniform(); TEST_VALIDITY(CTOperator2DnonUniform1); Step::RefPtr< ifc2x3::IfcDirection > Axis11 = eds->createIfcDirection(); ifc2x3::List_Real_2_3 ListReal11; ListReal11.push_back(1.0); ListReal11.push_back(0.0); Axis11->setDirectionRatios(ListReal11); CTOperator2DnonUniform1->setAxis1(Axis11); Step::RefPtr< ifc2x3::IfcDirection > Axis21 = eds->createIfcDirection(); ifc2x3::List_Real_2_3 ListReal21; ListReal21.push_back(0.0); ListReal21.push_back(1.0); Axis21->setDirectionRatios(ListReal21); CTOperator2DnonUniform1->setAxis2(Axis21); LOG_DEBUG("getScale2 = "<< Step::isUnset( CTOperator2DnonUniform1->getScale2()) << std::endl); TEST_ASSERT(Step::isUnset( CTOperator2DnonUniform1->getScale2())); LOG_DEBUG("getScl2 = "<< CTOperator2DnonUniform1->getScl2() << std::endl); TEST_ASSERT(CTOperator2DnonUniform1->getScl2()==1.0); LOG_DEBUG("getScl = "<< CTOperator2DnonUniform1->getScl() << std::endl); TEST_ASSERT(CTOperator2DnonUniform1->getScl()==1.0); /////////////////////////////////////////////////////////////////////////////////////////////////////////// LOG_DEBUG(std::endl << "Test with CTOperator2DnonUniform2->setScale(2.5);" << std::endl); Step::RefPtr<ifc2x3::IfcCartesianTransformationOperator2DnonUniform> CTOperator2DnonUniform2 = eds->createIfcCartesianTransformationOperator2DnonUniform(); TEST_VALIDITY(CTOperator2DnonUniform2); Step::RefPtr< ifc2x3::IfcDirection > Axis12 = eds->createIfcDirection(); ifc2x3::List_Real_2_3 ListReal12; ListReal12.push_back(2.0); ListReal12.push_back(1.0); Axis12->setDirectionRatios(ListReal12); CTOperator2DnonUniform2->setAxis1(Axis12); Step::RefPtr< ifc2x3::IfcDirection > Axis22 = eds->createIfcDirection(); ifc2x3::List_Real_2_3 ListReal22; ListReal22.push_back(4.0); ListReal22.push_back(1.0); Axis22->setDirectionRatios(ListReal22); CTOperator2DnonUniform2->setAxis2(Axis22); CTOperator2DnonUniform2->setScale(2.5); LOG_DEBUG("getScale2 = "<< Step::isUnset( CTOperator2DnonUniform2->getScale2()) << std::endl); TEST_ASSERT(Step::isUnset( CTOperator2DnonUniform2->getScale2())); LOG_DEBUG("getScl2 = "<< CTOperator2DnonUniform2->getScl2() << std::endl); TEST_ASSERT(CTOperator2DnonUniform2->getScl2()==2.5); LOG_DEBUG("getScl = "<< CTOperator2DnonUniform2->getScl() << std::endl); TEST_ASSERT(CTOperator2DnonUniform2->getScl()==2.5); CTOperator2DnonUniform2->setScale2(4.5); LOG_DEBUG(std::endl << "Test with CTOperator2DnonUniform2->setScale2(4.5);" << std::endl); LOG_DEBUG("getScale2 = "<< CTOperator2DnonUniform2->getScale2() << std::endl); TEST_ASSERT(CTOperator2DnonUniform2->getScale2()==4.5); LOG_DEBUG("getScl2 = "<< CTOperator2DnonUniform2->getScl2() << std::endl); TEST_ASSERT(CTOperator2DnonUniform2->getScl2()==4.5); LOG_DEBUG("getScl = "<< CTOperator2DnonUniform2->getScl() << std::endl); TEST_ASSERT(CTOperator2DnonUniform2->getScl()==2.5); /////////////////////////////////////////////////////////////////////////////////////////////////////////////// std::cout << std::endl << "Failure : " << failure_results << " Success : " << success_results << std::endl; return failure_results; }