示例#1
0
文件: main.cpp 项目: cstb/ifc-sdk
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;
}
示例#2
0
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;
}
示例#3
0
文件: main.cpp 项目: cstb/ifc-sdk
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::IfcRelConnectsPathElements> RelConnectsPathElements = eds->createIfcRelConnectsPathElements();
	TEST_VALIDITY(RelConnectsPathElements);
	LOG_DEBUG("RelConnectsPathElements->getRelatedLayerCount() = "<<RelConnectsPathElements->getRelatedLayerCount()<<std::endl);
	TEST_ASSERT(RelConnectsPathElements->getRelatedLayerCount()==0);
	LOG_DEBUG("RelConnectsPathElements->getRelatingLayerCount() = "<<RelConnectsPathElements->getRelatingLayerCount()<<std::endl);
	TEST_ASSERT(RelConnectsPathElements->getRelatingLayerCount()==0);
	
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	Step::RefPtr<ifc2x3::IfcRoot> Root1 = eds->createIfcOccupant();
	Root1->setName("Root1");
	Root1->setDescription("Root1Description");
	Step::RefPtr<ifc2x3::IfcRoot> Root2 = eds->createIfcActionRequest();
	Root2->setName("Root2");
	Root2->setDescription("Root2Description");
	Step::RefPtr<ifc2x3::IfcRoot> Root3 = eds->createIfcAsset();
	Root3->setName("Root3");
	Root3->setDescription("Root3Description");

	Step::RefPtr<ifc2x3::IfcElement> Element1 = eds->createIfcBeam();
	Element1->setTag("Beam");
	Step::RefPtr<ifc2x3::IfcElement> Element2 = eds->createIfcBuildingElementPart();
	Element2->setTag("BuildingPart");

	/*Step::RefPtr<ifc2x3::IfcElement> Element3 = eds->createIfcReinforcingBar();
	Element3->setTag("Reinforcing");
	Step::RefPtr<ifc2x3::IfcElement> Element4 = eds->createIfcBuildingElementProxy();
	Element4->setTag("BuildingProxy");
	Step::RefPtr<ifc2x3::IfcElement> Element5 = eds->createIfcColumn();
	Element5->setTag("Column");
	Step::RefPtr<ifc2x3::IfcElement> Element6 = eds->createIfcCovering();
	Element6->setTag("Covering");
	Step::RefPtr<ifc2x3::IfcElement> Element7 = eds->createIfcCurtainWall();
	Element7->setTag("CurtainWall");
	Step::RefPtr<ifc2x3::IfcElement> Element8 = eds->createIfcDoor();
	Element8->setTag("Door");
	Step::RefPtr<ifc2x3::IfcElement> Element9 = eds->createIfcFooting();
	Element9->setTag("Footing");
	Step::RefPtr<ifc2x3::IfcElement> Element10 = eds->createIfcMember();
	Element10->setTag("Member");
	Step::RefPtr<ifc2x3::IfcElement> Element11 = eds->createIfcPile();
	Element11->setTag("Pile");
	Step::RefPtr<ifc2x3::IfcElement> Element12 = eds->createIfcPlate();
	Element12->setTag("Plate");
	Step::RefPtr<ifc2x3::IfcElement> Element13 = eds->createIfcRailing();
	Element13->setTag("Railing");
	Step::RefPtr<ifc2x3::IfcElement> Element14 = eds->createIfcRamp();
	Element14->setTag("Ramp");
	Step::RefPtr<ifc2x3::IfcElement> Element15 = eds->createIfcRampFlight();
	Element15->setTag("RampFlight");
	Step::RefPtr<ifc2x3::IfcElement> Element16 = eds->createIfcRoof();
	Element16->setTag("Roof");
	Step::RefPtr<ifc2x3::IfcElement> Element17 = eds->createIfcSlab();
	Element17->setTag("Slab");
	Step::RefPtr<ifc2x3::IfcElement> Element18 = eds->createIfcStair();
	Element18->setTag("Stair");
	Step::RefPtr<ifc2x3::IfcElement> Element19 = eds->createIfcStairFlight();
	Element19->setTag("Column");
	Step::RefPtr<ifc2x3::IfcElement> Element20 = eds->createIfcWall();
	Element20->setTag("Wall");
	Step::RefPtr<ifc2x3::IfcElement> Element21 = eds->createIfcWindow();
	Element21->setTag("Window");
*/

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	ifc2x3::List_Integer_0_n RelatingPriorities;
	RelatingPriorities.push_back(0);
	RelatingPriorities.push_back(1);
	RelatingPriorities.push_back(2);
	ifc2x3::List_Integer_0_n RelatedPriorities;
	RelatedPriorities.push_back(0);
	RelatedPriorities.push_back(1);
	RelatedPriorities.push_back(2);
	RelatedPriorities.push_back(3);
	RelConnectsPathElements->setRelatingPriorities(RelatingPriorities);
	RelConnectsPathElements->setRelatedPriorities(RelatedPriorities);
	RelConnectsPathElements->setRelatedConnectionType(ifc2x3::IfcConnectionTypeEnum_ATPATH);
	RelConnectsPathElements->setRelatingConnectionType(ifc2x3::IfcConnectionTypeEnum_ATPATH);

	RelConnectsPathElements->setRelatingElement(Element1);
	RelConnectsPathElements->setRelatedElement(Element2);

	Step::RefPtr<ifc2x3::IfcBSplineCurve> BSpline1 = eds->createIfcBezierCurve();
//	TEST_VALIDITY(BSpline1);
//	TEST_ASSERT(BSpline1->getDim()==0);	

	ifc2x3::Array_IfcCartesianPoint_0_255 ControlPoint = BSpline1->getControlPoints();
	Step::Integer IndexOnControlPoints = BSpline1->getUpperIndexOnControlPoints();
//	TEST_ASSERT(ControlPoint.size()==256);
//	TEST_ASSERT(IndexOnControlPoints==0);

	ifc2x3::List_IfcLengthMeasure_1_3 Coordinates1;
	Coordinates1.push_back(0);
	Coordinates1.push_back(0);
	Coordinates1.push_back(0);
	Step::RefPtr< ifc2x3::IfcCartesianPoint > Point1 = eds->createIfcCartesianPoint();
	Point1->setCoordinates(Coordinates1);
	ifc2x3::List_IfcLengthMeasure_1_3 Coordinates2;
	Coordinates2.push_back(1);
	Coordinates2.push_back(1);
	Coordinates2.push_back(0);
	Step::RefPtr< ifc2x3::IfcCartesianPoint > Point2 = eds->createIfcCartesianPoint();
	Point2->setCoordinates(Coordinates2);
	ifc2x3::List_IfcLengthMeasure_1_3 Coordinates3;
	Coordinates3.push_back(2);
	Coordinates3.push_back(1);
	Coordinates3.push_back(0);
	Step::RefPtr< ifc2x3::IfcCartesianPoint > Point3 = eds->createIfcCartesianPoint();
	Point3->setCoordinates(Coordinates3);
	ifc2x3::List_IfcLengthMeasure_1_3 Coordinates4;
	Coordinates4.push_back(3);
	Coordinates4.push_back(0);
	Coordinates4.push_back(0);
	Step::RefPtr< ifc2x3::IfcCartesianPoint > Point4 = eds->createIfcCartesianPoint();
	Point1->setCoordinates(Coordinates4);
  	ifc2x3::List_IfcCartesianPoint_2_n ListOfIfcCartesianPoint;
	ListOfIfcCartesianPoint.push_back(Point1);
	ListOfIfcCartesianPoint.push_back(Point2);
	ListOfIfcCartesianPoint.push_back(Point3);
	ListOfIfcCartesianPoint.push_back(Point4);

	BSpline1->setControlPointsList(ListOfIfcCartesianPoint);
	//////////////////////
	Step::RefPtr<ifc2x3::IfcBSplineCurve> BSpline2 = eds->createIfcBezierCurve();
//	TEST_VALIDITY(BSpline2);
//	TEST_ASSERT(BSpline2->getDim()==0);	

	ifc2x3::Array_IfcCartesianPoint_0_255 ControlPoint2 = BSpline2->getControlPoints();
	Step::Integer IndexOnControlPoints2 = BSpline2->getUpperIndexOnControlPoints();
//	TEST_ASSERT(ControlPoint2.size()==256);
//	TEST_ASSERT(IndexOnControlPoints2==0);

	ifc2x3::List_IfcLengthMeasure_1_3 Coordinates12;
	Coordinates12.push_back(1);
	Coordinates12.push_back(1);
	Coordinates12.push_back(0);
	Step::RefPtr< ifc2x3::IfcCartesianPoint > Point12 = eds->createIfcCartesianPoint();
	Point12->setCoordinates(Coordinates12);
	ifc2x3::List_IfcLengthMeasure_1_3 Coordinates22;
	Coordinates22.push_back(2);
	Coordinates22.push_back(1);
	Coordinates22.push_back(0);
	Step::RefPtr< ifc2x3::IfcCartesianPoint > Point22 = eds->createIfcCartesianPoint();
	Point22->setCoordinates(Coordinates22);

	ifc2x3::List_IfcCartesianPoint_2_n ListOfIfcCartesianPoint2;
	ListOfIfcCartesianPoint2.push_back(Point12);
	ListOfIfcCartesianPoint2.push_back(Point22);
	BSpline2->setControlPointsList(ListOfIfcCartesianPoint2);

	Step::RefPtr< ifc2x3::IfcConnectionCurveGeometry > ConnectionGeometry = eds->createIfcConnectionCurveGeometry();
	ConnectionGeometry->setCurveOnRelatingElement(BSpline1);
	ConnectionGeometry->setCurveOnRelatedElement(BSpline2);
	RelConnectsPathElements->setConnectionGeometry(ConnectionGeometry);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////

	Step::RefPtr< ifc2x3::IfcRelAssociates > RelAssociates = eds->createIfcRelAssociatesMaterial();
	dynamic_cast< ifc2x3::IfcRelAssociatesMaterial* >(RelAssociates.get())->getRelatedObjects().insert(Root1);
	dynamic_cast< ifc2x3::IfcRelAssociatesMaterial* >(RelAssociates.get())->getRelatedObjects().insert(Root2);
	dynamic_cast< ifc2x3::IfcRelAssociatesMaterial* >(RelAssociates.get())->getRelatedObjects().insert(Root3);
	dynamic_cast< ifc2x3::IfcRelAssociatesMaterial* >(RelAssociates.get())->getRelatedObjects().insert(Element1);
	dynamic_cast< ifc2x3::IfcRelAssociatesMaterial* >(RelAssociates.get())->getRelatedObjects().insert(Element2);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	Step::RefPtr<ifc2x3::IfcMaterialSelect> MaterialSelectIfcMaterial = new ifc2x3::IfcMaterialSelect();
	Step::RefPtr<ifc2x3::IfcMaterial> Material = eds->createIfcMaterial();
	MaterialSelectIfcMaterial->setIfcMaterial(Material.get());
	dynamic_cast< ifc2x3::IfcRelAssociatesMaterial* >(RelAssociates.get())->setRelatingMaterial(MaterialSelectIfcMaterial);
	LOG_DEBUG("RelConnectsPathElements->getRelatedLayerCount() = "<<RelConnectsPathElements->getRelatedLayerCount()<<std::endl);
	TEST_ASSERT(RelConnectsPathElements->getRelatedLayerCount()==1);
	LOG_DEBUG("RelConnectsPathElements->getRelatingLayerCount() = "<<RelConnectsPathElements->getRelatingLayerCount()<<std::endl);
	TEST_ASSERT(RelConnectsPathElements->getRelatingLayerCount()==1);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	Step::RefPtr<ifc2x3::IfcMaterialList> MaterialList = eds->createIfcMaterialList();
	Step::RefPtr<ifc2x3::IfcMaterialSelect> MaterialSelectIfcMaterialList = new ifc2x3::IfcMaterialSelect();
	MaterialSelectIfcMaterialList->setIfcMaterialList(MaterialList.get());
	dynamic_cast< ifc2x3::IfcRelAssociatesMaterial* >(RelAssociates.get())->setRelatingMaterial(MaterialSelectIfcMaterialList);
	LOG_DEBUG("RelConnectsPathElements->getRelatedLayerCount() = "<<RelConnectsPathElements->getRelatedLayerCount()<<std::endl);
	TEST_ASSERT(RelConnectsPathElements->getRelatedLayerCount()==0);
	LOG_DEBUG("RelConnectsPathElements->getRelatingLayerCount() = "<<RelConnectsPathElements->getRelatingLayerCount()<<std::endl);
	TEST_ASSERT(RelConnectsPathElements->getRelatingLayerCount()==0);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	Step::RefPtr< ifc2x3::IfcMaterialSelect > MaterialSelectIfcMaterialLayerSetUsage = new ifc2x3::IfcMaterialSelect();
	Step::RefPtr< ifc2x3::IfcMaterialLayerSetUsage > MaterialLayerSetUsage = eds->createIfcMaterialLayerSetUsage();
	Step::RefPtr< ifc2x3::IfcMaterialLayerSet > MaterialLayerSet = eds->createIfcMaterialLayerSet();
	MaterialLayerSet->setLayerSetName("LayerSet");
	Step::RefPtr< ifc2x3::IfcMaterialLayer > MaterialLayer1 = eds->createIfcMaterialLayer();
	MaterialLayerSet->getMaterialLayers().push_back(MaterialLayer1);
	MaterialLayerSetUsage->setForLayerSet(MaterialLayerSet);
	MaterialSelectIfcMaterialLayerSetUsage->setIfcMaterialLayerSetUsage(MaterialLayerSetUsage.get());
	dynamic_cast< ifc2x3::IfcRelAssociatesMaterial* >(RelAssociates.get())->setRelatingMaterial(MaterialSelectIfcMaterialLayerSetUsage);
	LOG_DEBUG("RelConnectsPathElements->getRelatedLayerCount() = "<<RelConnectsPathElements->getRelatedLayerCount()<<std::endl);
	TEST_ASSERT(RelConnectsPathElements->getRelatedLayerCount()==1);
	LOG_DEBUG("RelConnectsPathElements->getRelatingLayerCount() = "<<RelConnectsPathElements->getRelatingLayerCount()<<std::endl);
	TEST_ASSERT(RelConnectsPathElements->getRelatingLayerCount()==1);
	Step::RefPtr< ifc2x3::IfcMaterialLayer > MaterialLayer2 = eds->createIfcMaterialLayer();
	MaterialLayerSet->getMaterialLayers().push_back(MaterialLayer2);
	MaterialLayerSetUsage->setForLayerSet(MaterialLayerSet);
	MaterialSelectIfcMaterialLayerSetUsage->setIfcMaterialLayerSetUsage(MaterialLayerSetUsage.get());
	dynamic_cast< ifc2x3::IfcRelAssociatesMaterial* >(RelAssociates.get())->setRelatingMaterial(MaterialSelectIfcMaterialLayerSetUsage);
	LOG_DEBUG("RelConnectsPathElements->getRelatedLayerCount() = "<<RelConnectsPathElements->getRelatedLayerCount()<<std::endl);
	TEST_ASSERT(RelConnectsPathElements->getRelatedLayerCount()==2);
	LOG_DEBUG("RelConnectsPathElements->getRelatingLayerCount() = "<<RelConnectsPathElements->getRelatingLayerCount()<<std::endl);
	TEST_ASSERT(RelConnectsPathElements->getRelatingLayerCount()==2);

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	std::cout << std::endl << "Failure : " << failure_results << " Success : " << success_results << std::endl;

	return failure_results;
}
示例#4
0
文件: main.cpp 项目: cstb/ifc-sdk
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;
}
示例#5
0
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;
}
示例#6
0
文件: main.cpp 项目: cstb/ifc-sdk
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::IfcEdgeLoop> EdgeLoop = eds->createIfcEdgeLoop();
	TEST_VALIDITY(EdgeLoop);
	TEST_ASSERT(EdgeLoop->getNe()==0);

	Step::RefPtr<ifc2x3::IfcOrientedEdge> OrientedEdge1 = eds->createIfcOrientedEdge();
	TEST_VALIDITY(OrientedEdge1);
	Step::RefPtr<ifc2x3::IfcCartesianPoint> PointStart1 = eds->createIfcCartesianPoint();
	PointStart1->getCoordinates().push_back(0);
	PointStart1->getCoordinates().push_back(0);
	PointStart1->getCoordinates().push_back(0);
	Step::RefPtr<ifc2x3::IfcCartesianPoint> PointEnd1 = eds->createIfcCartesianPoint();
	PointEnd1->getCoordinates().push_back(1);
	PointEnd1->getCoordinates().push_back(1);
	PointEnd1->getCoordinates().push_back(1);
	OrientedEdge1->setEdgeStart(PointStart1);
	OrientedEdge1->setEdgeEnd(PointEnd1);

	EdgeLoop->getEdgeList().push_back(OrientedEdge1);
	TEST_ASSERT(EdgeLoop->getNe()==1);
	LOG_DEBUG("EdgeLoop->getNe() = " <<EdgeLoop->getNe()<< std::endl);
////////////////////////////////////////////////////////////////////////////////////////////////////////////
	Step::RefPtr<ifc2x3::IfcOrientedEdge> OrientedEdge2 = eds->createIfcOrientedEdge();
	TEST_VALIDITY(OrientedEdge2);
	Step::RefPtr<ifc2x3::IfcCartesianPoint> PointStart2 = eds->createIfcCartesianPoint();
	PointStart2->getCoordinates().push_back(0);
	PointStart2->getCoordinates().push_back(0);
	PointStart2->getCoordinates().push_back(0);
	Step::RefPtr<ifc2x3::IfcCartesianPoint> PointEnd2 = eds->createIfcCartesianPoint();
	PointEnd2->getCoordinates().push_back(1);
	PointEnd2->getCoordinates().push_back(1);
	PointEnd2->getCoordinates().push_back(1);
	OrientedEdge2->setEdgeStart(PointStart2);
	OrientedEdge2->setEdgeEnd(PointEnd2);
	EdgeLoop->getEdgeList().push_back(OrientedEdge2);
	TEST_ASSERT(EdgeLoop->getNe()==2);
	LOG_DEBUG("EdgeLoop->getNe() = " <<EdgeLoop->getNe()<< std::endl);
////////////////////////////////////////////////////////////////////////////////////////////////////////////
	Step::RefPtr<ifc2x3::IfcOrientedEdge> OrientedEdge3 = eds->createIfcOrientedEdge();
	TEST_VALIDITY(OrientedEdge3);
	Step::RefPtr<ifc2x3::IfcCartesianPoint> PointStart3 = eds->createIfcCartesianPoint();
	PointStart3->getCoordinates().push_back(0);
	PointStart3->getCoordinates().push_back(0);
	PointStart3->getCoordinates().push_back(0);
	Step::RefPtr<ifc2x3::IfcCartesianPoint> PointEnd3 = eds->createIfcCartesianPoint();
	PointEnd3->getCoordinates().push_back(1);
	PointEnd3->getCoordinates().push_back(1);
	PointEnd3->getCoordinates().push_back(1);
	OrientedEdge3->setEdgeStart(PointStart3);
	OrientedEdge3->setEdgeEnd(PointEnd3);
	EdgeLoop->getEdgeList().push_back(OrientedEdge3);
	TEST_ASSERT(EdgeLoop->getNe()==3);
	LOG_DEBUG("EdgeLoop->getNe() = " <<EdgeLoop->getNe()<< std::endl);
////////////////////////////////////////////////////////////////////////////////////////////////////////////
	Step::RefPtr<ifc2x3::IfcOrientedEdge> OrientedEdge4 = eds->createIfcOrientedEdge();
	TEST_VALIDITY(OrientedEdge4);
	Step::RefPtr<ifc2x3::IfcCartesianPoint> PointStart4 = eds->createIfcCartesianPoint();
	PointStart4->getCoordinates().push_back(0);
	PointStart4->getCoordinates().push_back(0);
	PointStart4->getCoordinates().push_back(0);
	Step::RefPtr<ifc2x3::IfcCartesianPoint> PointEnd4 = eds->createIfcCartesianPoint();
	PointEnd4->getCoordinates().push_back(1);
	PointEnd4->getCoordinates().push_back(1);
	PointEnd4->getCoordinates().push_back(1);
	OrientedEdge4->setEdgeStart(PointStart4);
	OrientedEdge4->setEdgeEnd(PointEnd4);
	EdgeLoop->getEdgeList().push_back(OrientedEdge4);
	TEST_ASSERT(EdgeLoop->getNe()==4);
	LOG_DEBUG("EdgeLoop->getNe() = " <<EdgeLoop->getNe()<< std::endl);
////////////////////////////////////////////////////////////////////////////////////////////////////////////
	

	std::cout << std::endl << "Failure : " << failure_results << " Success : " << success_results << std::endl;

	return failure_results;
}