Пример #1
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::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
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::IfcCompositeCurve> CompositeCurve = eds->createIfcCompositeCurve();
	TEST_VALIDITY(CompositeCurve);

	TEST_ASSERT(CompositeCurve->getNSegments()==0);
	TEST_ASSERT(CompositeCurve->getClosedCurve()==Step::LUnset);

	Step::RefPtr<ifc2x3::IfcCompositeCurveSegment> CompositeCurveSegment1 = eds->createIfcCompositeCurveSegment();
	CompositeCurve->getSegments().push_back(CompositeCurveSegment1);
	Step::RefPtr<ifc2x3::IfcCompositeCurveSegment> CompositeCurveSegment2 = eds->createIfcCompositeCurveSegment();
	CompositeCurve->getSegments().push_back(CompositeCurveSegment2);
	Step::RefPtr<ifc2x3::IfcCompositeCurveSegment> CompositeCurveSegment3 = eds->createIfcCompositeCurveSegment();
	CompositeCurve->getSegments().push_back(CompositeCurveSegment3);
	Step::RefPtr<ifc2x3::IfcCompositeCurveSegment> CompositeCurveSegment4 = eds->createIfcCompositeCurveSegment();
	
	TEST_ASSERT(CompositeCurve->getNSegments()==3);
	ifc2x3::IfcTransitionCode Transition1 = ifc2x3::IfcTransitionCode_CONTINUOUS;
	CompositeCurveSegment4->setTransition(Transition1);
	CompositeCurve->getSegments().push_back(CompositeCurveSegment4);

	TEST_ASSERT(CompositeCurve->getNSegments()==4);
	TEST_ASSERT(CompositeCurve->getClosedCurve()==Step::LTrue);

	Step::RefPtr<ifc2x3::IfcCompositeCurveSegment> CompositeCurveSegment5 = eds->createIfcCompositeCurveSegment();
	CompositeCurve->getSegments().push_back(CompositeCurveSegment5);

	ifc2x3::IfcTransitionCode Transition2 = ifc2x3::IfcTransitionCode_DISCONTINUOUS;
	CompositeCurveSegment5->setTransition(Transition2);

	TEST_ASSERT(CompositeCurve->getNSegments()==5);
	TEST_ASSERT(CompositeCurve->getClosedCurve()==Step::LFalse);

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

	return failure_results;
}
Пример #4
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::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;
}
Пример #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::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;
}
Пример #6
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::IfcSectionedSpine> SectionedSpine = eds->createIfcSectionedSpine();
	TEST_VALIDITY(SectionedSpine);

	TEST_ASSERT(SectionedSpine->getDim()==3);

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

	return failure_results;
}
Пример #7
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::IfcCsgPrimitive3D> CsgPrimitive3DBlock = eds->createIfcBlock();
	TEST_VALIDITY(CsgPrimitive3DBlock);
	TEST_ASSERT(CsgPrimitive3DBlock->getDim()==3);

	Step::RefPtr<ifc2x3::IfcCsgPrimitive3D> CsgPrimitive3DRectangularPyramid = eds->createIfcRectangularPyramid();
	TEST_VALIDITY(CsgPrimitive3DRectangularPyramid);
	TEST_ASSERT(CsgPrimitive3DRectangularPyramid->getDim()==3);

	Step::RefPtr<ifc2x3::IfcCsgPrimitive3D> CsgPrimitive3DRightCircularCone = eds->createIfcRightCircularCone();
	TEST_VALIDITY(CsgPrimitive3DRightCircularCone);
	TEST_ASSERT(CsgPrimitive3DRightCircularCone->getDim()==3);

	Step::RefPtr<ifc2x3::IfcCsgPrimitive3D> CsgPrimitive3DRightCircularCylinder = eds->createIfcRightCircularCylinder();
	TEST_VALIDITY(CsgPrimitive3DRightCircularCylinder);
	TEST_ASSERT(CsgPrimitive3DRightCircularCylinder->getDim()==3);

	Step::RefPtr<ifc2x3::IfcCsgPrimitive3D> CsgPrimitive3DSphere = eds->createIfcSphere();
	TEST_VALIDITY(CsgPrimitive3DSphere);
	TEST_ASSERT(CsgPrimitive3DSphere->getDim()==3);

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

	return failure_results;
}
Пример #8
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::IfcSIUnit> SIUnit = eds->createIfcSIUnit();
	TEST_VALIDITY(SIUnit);
	//TEST_ASSERT(SIUnit->getDimensions()==0);

	Step::RefPtr<ifc2x3::IfcDimensionalExponents> DimensionalExponents = eds->createIfcDimensionalExponents();

	DimensionalExponents->setLengthExponent(1);
	DimensionalExponents->setMassExponent(1);
	DimensionalExponents->setTimeExponent(1);
	DimensionalExponents->setElectricCurrentExponent(1);			
	DimensionalExponents->setThermodynamicTemperatureExponent(1);
	DimensionalExponents->setAmountOfSubstanceExponent(1);
	DimensionalExponents->setLuminousIntensityExponent(1);
	SIUnit->setDimensions(DimensionalExponents);

	Step::RefPtr<ifc2x3::IfcDimensionalExponents> ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
/*    
IfcUnitEnum_UNSET,
IfcUnitEnum_ABSORBEDDOSEUNIT,
IfcUnitEnum_AMOUNTOFSUBSTANCEUNIT,
IfcUnitEnum_AREAUNIT,
IfcUnitEnum_DOSEEQUIVALENTUNIT,
IfcUnitEnum_ELECTRICCAPACITANCEUNIT,
IfcUnitEnum_ELECTRICCHARGEUNIT,
IfcUnitEnum_ELECTRICCONDUCTANCEUNIT,
IfcUnitEnum_ELECTRICCURRENTUNIT,
IfcUnitEnum_ELECTRICRESISTANCEUNIT,
IfcUnitEnum_ELECTRICVOLTAGEUNIT,
IfcUnitEnum_ENERGYUNIT,
IfcUnitEnum_FORCEUNIT,
IfcUnitEnum_FREQUENCYUNIT,
IfcUnitEnum_ILLUMINANCEUNIT,
IfcUnitEnum_INDUCTANCEUNIT,
IfcUnitEnum_LENGTHUNIT,
IfcUnitEnum_LUMINOUSFLUXUNIT,
IfcUnitEnum_LUMINOUSINTENSITYUNIT,
IfcUnitEnum_MAGNETICFLUXDENSITYUNIT,
IfcUnitEnum_MAGNETICFLUXUNIT,
IfcUnitEnum_MASSUNIT,
IfcUnitEnum_PLANEANGLEUNIT,
IfcUnitEnum_POWERUNIT,
IfcUnitEnum_PRESSUREUNIT,
IfcUnitEnum_RADIOACTIVITYUNIT,
IfcUnitEnum_SOLIDANGLEUNIT,
IfcUnitEnum_THERMODYNAMICTEMPERATUREUNIT,
IfcUnitEnum_TIMEUNIT,
IfcUnitEnum_VOLUMEUNIT,
IfcUnitEnum_USERDEFINED,
*/
	SIUnit->setUnitType(ifc2x3::IfcUnitEnum_ABSORBEDDOSEUNIT);
/*
IfcSIPrefix_UNSET,
IfcSIPrefix_EXA,
IfcSIPrefix_PETA,
IfcSIPrefix_TERA,
IfcSIPrefix_GIGA,
IfcSIPrefix_MEGA,
IfcSIPrefix_KILO,
IfcSIPrefix_HECTO,
IfcSIPrefix_DECA,
IfcSIPrefix_DECI,
IfcSIPrefix_CENTI,
IfcSIPrefix_MILLI,
IfcSIPrefix_MICRO,
IfcSIPrefix_NANO,
IfcSIPrefix_PICO,
IfcSIPrefix_FEMTO,
IfcSIPrefix_ATTO,
*/
	SIUnit->setPrefix(ifc2x3::IfcSIPrefix_EXA);
/*
IfcSIUnitName_UNSET,
IfcSIUnitName_AMPERE,
IfcSIUnitName_BECQUEREL,
IfcSIUnitName_CANDELA,
IfcSIUnitName_COULOMB,
IfcSIUnitName_CUBIC_METRE,
IfcSIUnitName_DEGREE_CELSIUS,
IfcSIUnitName_FARAD,
IfcSIUnitName_GRAM,
IfcSIUnitName_GRAY,
IfcSIUnitName_HENRY,
IfcSIUnitName_HERTZ,
IfcSIUnitName_JOULE,
IfcSIUnitName_KELVIN,
IfcSIUnitName_LUMEN,
IfcSIUnitName_LUX,
IfcSIUnitName_METRE,
IfcSIUnitName_MOLE,
IfcSIUnitName_NEWTON,
IfcSIUnitName_OHM,
IfcSIUnitName_PASCAL,
IfcSIUnitName_RADIAN,
IfcSIUnitName_SECOND,
IfcSIUnitName_SIEMENS,
IfcSIUnitName_SIEVERT,
IfcSIUnitName_SQUARE_METRE,
IfcSIUnitName_STERADIAN,
IfcSIUnitName_TESLA,
IfcSIUnitName_VOLT,
IfcSIUnitName_WATT,
IfcSIUnitName_WEBER,*/
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_METRE");
	SIUnit->setName(ifc2x3::IfcSIUnitName_METRE);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_SQUARE_METRE");
	SIUnit->setName(ifc2x3::IfcSIUnitName_SQUARE_METRE);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==2);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_CUBIC_METRE");
	SIUnit->setName(ifc2x3::IfcSIUnitName_CUBIC_METRE);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==3);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_GRAM");
	SIUnit->setName(ifc2x3::IfcSIUnitName_GRAM);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_SECOND");
	SIUnit->setName(ifc2x3::IfcSIUnitName_SECOND);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_AMPERE");
	SIUnit->setName(ifc2x3::IfcSIUnitName_AMPERE);
	
	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_KELVIN");
	SIUnit->setName(ifc2x3::IfcSIUnitName_KELVIN);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_MOLE");
	SIUnit->setName(ifc2x3::IfcSIUnitName_MOLE);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_CANDELA");
	SIUnit->setName(ifc2x3::IfcSIUnitName_CANDELA);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==1);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_RADIAN");
	SIUnit->setName(ifc2x3::IfcSIUnitName_RADIAN);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_STERADIAN");
	SIUnit->setName(ifc2x3::IfcSIUnitName_STERADIAN);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_HERTZ");
	SIUnit->setName(ifc2x3::IfcSIUnitName_HERTZ);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-1);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_NEWTON");
	SIUnit->setName(ifc2x3::IfcSIUnitName_NEWTON);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_PASCAL");
	SIUnit->setName(ifc2x3::IfcSIUnitName_PASCAL);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==-1);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_JOULE");
	SIUnit->setName(ifc2x3::IfcSIUnitName_JOULE);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==2);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_WATT");
	SIUnit->setName(ifc2x3::IfcSIUnitName_WATT);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==2);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-3);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_COULOMB");
	SIUnit->setName(ifc2x3::IfcSIUnitName_COULOMB);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_VOLT");
	SIUnit->setName(ifc2x3::IfcSIUnitName_VOLT);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==2);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-3);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==-1);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);

////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_FARAD");
	SIUnit->setName(ifc2x3::IfcSIUnitName_FARAD);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==-1);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==4);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_OHM");
	SIUnit->setName(ifc2x3::IfcSIUnitName_OHM);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==2);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-3);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_SIEMENS");
	SIUnit->setName(ifc2x3::IfcSIUnitName_SIEMENS);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==-1);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==3);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==2);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_WEBER");
	SIUnit->setName(ifc2x3::IfcSIUnitName_WEBER);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==2);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==-1);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_TESLA");
	SIUnit->setName(ifc2x3::IfcSIUnitName_TESLA);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==-1);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_HENRY");
	SIUnit->setName(ifc2x3::IfcSIUnitName_HENRY);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==2);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_DEGREE_CELSIUS");
	SIUnit->setName(ifc2x3::IfcSIUnitName_DEGREE_CELSIUS);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==1);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_LUMEN");
	SIUnit->setName(ifc2x3::IfcSIUnitName_LUMEN);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==1);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_LUX");
	SIUnit->setName(ifc2x3::IfcSIUnitName_LUX);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==1);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_BECQUEREL");
	SIUnit->setName(ifc2x3::IfcSIUnitName_BECQUEREL);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-1);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_GRAY");
	SIUnit->setName(ifc2x3::IfcSIUnitName_GRAY);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==2);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);
////////////////////////////////////////////////////////////////////////////////////////////////////////
	LOG_DEBUG("IfcSIUnitName_SIEVERT");
	SIUnit->setName(ifc2x3::IfcSIUnitName_SIEVERT);

	ResultDimensionalExponents = SIUnit->getDimensions();
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==2);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==-2);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);

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

	return failure_results;
}
Пример #9
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;
}
Пример #10
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::IfcBooleanResult> BoolRes = eds->createIfcBooleanResult();

	LOG_DEBUG("TEST IFCSOLIDMODEL");
	Step::RefPtr<ifc2x3::IfcCsgSolid> BoolRestmp1 = eds->createIfcCsgSolid();
	Step::RefPtr<ifc2x3::IfcSweptDiskSolid> BoolRestmp2 = eds->createIfcSweptDiskSolid();

	Step::RefPtr<ifc2x3::IfcBooleanOperand> FirstOperand = new ifc2x3::IfcBooleanOperand();
	Step::RefPtr<ifc2x3::IfcBooleanOperand> SecondOperand = new ifc2x3::IfcBooleanOperand();

	FirstOperand->setIfcSolidModel(BoolRestmp1.get());
	SecondOperand->setIfcSolidModel(BoolRestmp2.get());

	BoolRes->setFirstOperand(FirstOperand);
	BoolRes->setSecondOperand(SecondOperand);

	ifc2x3::IfcDimensionCount Dim = BoolRes->getDim();
	TEST_ASSERT(Dim==BoolRestmp1->getDim());
	TEST_ASSERT(Dim==3);

	LOG_DEBUG("TEST IFCHALFSPACESOLID");
	Step::RefPtr<ifc2x3::IfcHalfSpaceSolid> BoolRestmp3 = eds->createIfcHalfSpaceSolid();
	Step::RefPtr<ifc2x3::IfcHalfSpaceSolid> BoolRestmp4 = eds->createIfcHalfSpaceSolid();

	FirstOperand->setIfcHalfSpaceSolid(BoolRestmp3.get());
	SecondOperand->setIfcHalfSpaceSolid(BoolRestmp4.get());

	BoolRes->setFirstOperand(FirstOperand);
	BoolRes->setSecondOperand(SecondOperand);

	Dim = BoolRes->getDim();
	TEST_ASSERT(Dim==BoolRestmp3->getDim());
	TEST_ASSERT(Dim==3);

	LOG_DEBUG("TEST IFCCSGPRIMITIVE3D");
	Step::RefPtr<ifc2x3::IfcBlock> BoolRestmp5 = eds->createIfcBlock();
	Step::RefPtr<ifc2x3::IfcSphere> BoolRestmp6 = eds->createIfcSphere();

	FirstOperand->setIfcCsgPrimitive3D(BoolRestmp5.get());
	SecondOperand->setIfcCsgPrimitive3D(BoolRestmp6.get());

	BoolRes->setFirstOperand(FirstOperand);
	BoolRes->setSecondOperand(SecondOperand);

	Dim = BoolRes->getDim();
	TEST_ASSERT(Dim==BoolRestmp5->getDim());
	TEST_ASSERT(Dim==3);

	LOG_DEBUG("TEST IFCBOOLEANRESULT");
	Step::RefPtr<ifc2x3::IfcBooleanResult> BoolRestmp7 = eds->createIfcBooleanResult();
	Step::RefPtr<ifc2x3::IfcBooleanResult> BoolRestmp8 = eds->createIfcBooleanResult();

	Step::RefPtr<ifc2x3::IfcHalfSpaceSolid> BoolRestmp7_1 = eds->createIfcHalfSpaceSolid();
	Step::RefPtr<ifc2x3::IfcHalfSpaceSolid> BoolRestmp7_2 = eds->createIfcHalfSpaceSolid();

	Step::RefPtr<ifc2x3::IfcBlock> BoolRestmp8_1 = eds->createIfcBlock();
	Step::RefPtr<ifc2x3::IfcSphere> BoolRestmp8_2 = eds->createIfcSphere();

	Step::RefPtr<ifc2x3::IfcBooleanOperand> FirstOperand_7 = new ifc2x3::IfcBooleanOperand();
	Step::RefPtr<ifc2x3::IfcBooleanOperand> SecondOperand_7 = new ifc2x3::IfcBooleanOperand();

	FirstOperand_7->setIfcHalfSpaceSolid(BoolRestmp7_1.get());
	SecondOperand_7->setIfcHalfSpaceSolid(BoolRestmp7_2.get());

	Step::RefPtr<ifc2x3::IfcBooleanOperand> FirstOperand_8 = new ifc2x3::IfcBooleanOperand();
	Step::RefPtr<ifc2x3::IfcBooleanOperand> SecondOperand_8 = new ifc2x3::IfcBooleanOperand();

	FirstOperand_8->setIfcCsgPrimitive3D(BoolRestmp8_1.get());
	SecondOperand_8->setIfcCsgPrimitive3D(BoolRestmp8_2.get());

	BoolRestmp7->setFirstOperand(FirstOperand_7);
	BoolRestmp7->setSecondOperand(SecondOperand_7);

	BoolRestmp8->setFirstOperand(FirstOperand_8);
	BoolRestmp8->setSecondOperand(SecondOperand_8);

	FirstOperand->setIfcBooleanResult(BoolRestmp7.get());
	SecondOperand->setIfcBooleanResult(BoolRestmp8.get());

	BoolRes->setFirstOperand(FirstOperand);
	BoolRes->setSecondOperand(SecondOperand);

	Dim = BoolRes->getDim();

	TEST_ASSERT(Dim==BoolRestmp7->getDim());
	TEST_ASSERT(Dim==3);

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

	return failure_results;
}
Пример #11
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::IfcDerivedUnit> DerivedUnit = eds->createIfcDerivedUnit();
	TEST_VALIDITY(DerivedUnit);
	Step::RefPtr<ifc2x3::IfcDimensionalExponents> ResultDimensionalExponents = DerivedUnit->getDimensions();
	TEST_VALIDITY(ResultDimensionalExponents);

	LOG_DEBUG("ResultDimensionalExponents->getLengthExponent() = " << ResultDimensionalExponents->getLengthExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==0);
	LOG_DEBUG("ResultDimensionalExponents->getMassExponent() = " << ResultDimensionalExponents->getMassExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==0);
	LOG_DEBUG("ResultDimensionalExponents->getTimeExponent() = " << ResultDimensionalExponents->getTimeExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==0);
	LOG_DEBUG("ResultDimensionalExponents->getElectricCurrentExponent() = " << ResultDimensionalExponents->getElectricCurrentExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==0);
	LOG_DEBUG("ResultDimensionalExponents->getThermodynamicTemperatureExponent() = " << ResultDimensionalExponents->getThermodynamicTemperatureExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==0);
	LOG_DEBUG("ResultDimensionalExponents->getAmountOfSubstanceExponent() = " << ResultDimensionalExponents->getAmountOfSubstanceExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==0);
	LOG_DEBUG("ResultDimensionalExponents->getLuminousIntensityExponent() = " << ResultDimensionalExponents->getLuminousIntensityExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==0);

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
	Step::RefPtr<ifc2x3::IfcDerivedUnitElement> DerivedUnitElement1 = eds->createIfcDerivedUnitElement();
	Step::RefPtr<ifc2x3::IfcNamedUnit> ContextDependentUnit1 = eds->createIfcContextDependentUnit();
	Step::RefPtr<ifc2x3::IfcDimensionalExponents> DimensionalExponents1 = eds->createIfcDimensionalExponents();

	DimensionalExponents1->setLengthExponent(1);
	DimensionalExponents1->setMassExponent(1);
	DimensionalExponents1->setTimeExponent(1);
	DimensionalExponents1->setElectricCurrentExponent(1);			
	DimensionalExponents1->setThermodynamicTemperatureExponent(1);
	DimensionalExponents1->setAmountOfSubstanceExponent(1);
	DimensionalExponents1->setLuminousIntensityExponent(1);
	
	ContextDependentUnit1->setDimensions(DimensionalExponents1);
	
	DerivedUnitElement1->setUnit(ContextDependentUnit1);
	DerivedUnitElement1->setExponent(1);

	Step::RefPtr<ifc2x3::IfcDerivedUnitElement> DerivedUnitElement2 = eds->createIfcDerivedUnitElement();
	Step::RefPtr<ifc2x3::IfcNamedUnit> ContextDependentUnit2 = eds->createIfcContextDependentUnit();
	Step::RefPtr<ifc2x3::IfcDimensionalExponents> DimensionalExponents2 = eds->createIfcDimensionalExponents();
	DimensionalExponents2->setLengthExponent(2);
	DimensionalExponents2->setMassExponent(2);
	DimensionalExponents2->setTimeExponent(2);
	DimensionalExponents2->setElectricCurrentExponent(2);			
	DimensionalExponents2->setThermodynamicTemperatureExponent(2);
	DimensionalExponents2->setAmountOfSubstanceExponent(2);
	DimensionalExponents2->setLuminousIntensityExponent(2);
	ContextDependentUnit2->setDimensions(DimensionalExponents2);
	DerivedUnitElement2->setUnit(ContextDependentUnit2);
	DerivedUnitElement2->setExponent(2);

	Step::RefPtr<ifc2x3::IfcDerivedUnitElement> DerivedUnitElement3 = eds->createIfcDerivedUnitElement();
	Step::RefPtr<ifc2x3::IfcNamedUnit> ContextDependentUnit3 = eds->createIfcContextDependentUnit();
	Step::RefPtr<ifc2x3::IfcDimensionalExponents> DimensionalExponents3 = eds->createIfcDimensionalExponents();
	DimensionalExponents3->setLengthExponent(3);
	DimensionalExponents3->setMassExponent(3);
	DimensionalExponents3->setTimeExponent(3);
	DimensionalExponents3->setElectricCurrentExponent(3);			
	DimensionalExponents3->setThermodynamicTemperatureExponent(3);
	DimensionalExponents3->setAmountOfSubstanceExponent(3);
	DimensionalExponents3->setLuminousIntensityExponent(3);
	ContextDependentUnit3->setDimensions(DimensionalExponents3);
	DerivedUnitElement3->setUnit(ContextDependentUnit3);
	DerivedUnitElement3->setExponent(3);

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

	ifc2x3::Set_IfcDerivedUnitElement_1_n SetDerivedUnitElement;

	SetDerivedUnitElement.insert(DerivedUnitElement1);
	
	DerivedUnit->setElements(SetDerivedUnitElement);

	ResultDimensionalExponents = DerivedUnit->getDimensions();
	
	LOG_DEBUG("ResultDimensionalExponents->getLengthExponent() = " << ResultDimensionalExponents->getLengthExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==1);
	LOG_DEBUG("ResultDimensionalExponents->getMassExponent() = " << ResultDimensionalExponents->getMassExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==1);
	LOG_DEBUG("ResultDimensionalExponents->getTimeExponent() = " << ResultDimensionalExponents->getTimeExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==1);
	LOG_DEBUG("ResultDimensionalExponents->getElectricCurrentExponent() = " << ResultDimensionalExponents->getElectricCurrentExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==1);
	LOG_DEBUG("ResultDimensionalExponents->getThermodynamicTemperatureExponent() = " << ResultDimensionalExponents->getThermodynamicTemperatureExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==1);
	LOG_DEBUG("ResultDimensionalExponents->getAmountOfSubstanceExponent() = " << ResultDimensionalExponents->getAmountOfSubstanceExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==1);
	LOG_DEBUG("ResultDimensionalExponents->getLuminousIntensityExponent() = " << ResultDimensionalExponents->getLuminousIntensityExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==1);


/////////////////////////////////////////////////////////////////////////////////////////////////////////////
	SetDerivedUnitElement.insert(DerivedUnitElement2);
	DerivedUnit->setElements(SetDerivedUnitElement);

	ResultDimensionalExponents = DerivedUnit->getDimensions();

	LOG_DEBUG("ResultDimensionalExponents->getLengthExponent() = " << ResultDimensionalExponents->getLengthExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==5);
	LOG_DEBUG("ResultDimensionalExponents->getMassExponent() = " << ResultDimensionalExponents->getMassExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==5);
	LOG_DEBUG("ResultDimensionalExponents->getTimeExponent() = " << ResultDimensionalExponents->getTimeExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==5);
	LOG_DEBUG("ResultDimensionalExponents->getElectricCurrentExponent() = " << ResultDimensionalExponents->getElectricCurrentExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==5);
	LOG_DEBUG("ResultDimensionalExponents->getThermodynamicTemperatureExponent() = " << ResultDimensionalExponents->getThermodynamicTemperatureExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==5);
	LOG_DEBUG("ResultDimensionalExponents->getAmountOfSubstanceExponent() = " << ResultDimensionalExponents->getAmountOfSubstanceExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==5);
	LOG_DEBUG("ResultDimensionalExponents->getLuminousIntensityExponent() = " << ResultDimensionalExponents->getLuminousIntensityExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==5);

/////////////////////////////////////////////////////////////////////////////////////////////////////////////
	SetDerivedUnitElement.insert(DerivedUnitElement3);
	DerivedUnit->setElements(SetDerivedUnitElement);

	ResultDimensionalExponents = DerivedUnit->getDimensions();

	LOG_DEBUG("ResultDimensionalExponents->getLengthExponent() = " << ResultDimensionalExponents->getLengthExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getLengthExponent()==14);
	LOG_DEBUG("ResultDimensionalExponents->getMassExponent() = " << ResultDimensionalExponents->getMassExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getMassExponent()==14);
	LOG_DEBUG("ResultDimensionalExponents->getTimeExponent() = " << ResultDimensionalExponents->getTimeExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getTimeExponent()==14);
	LOG_DEBUG("ResultDimensionalExponents->getElectricCurrentExponent() = " << ResultDimensionalExponents->getElectricCurrentExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getElectricCurrentExponent()==14);
	LOG_DEBUG("ResultDimensionalExponents->getThermodynamicTemperatureExponent() = " << ResultDimensionalExponents->getThermodynamicTemperatureExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getThermodynamicTemperatureExponent()==14);
	LOG_DEBUG("ResultDimensionalExponents->getAmountOfSubstanceExponent() = " << ResultDimensionalExponents->getAmountOfSubstanceExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getAmountOfSubstanceExponent()==14);
	LOG_DEBUG("ResultDimensionalExponents->getLuminousIntensityExponent() = " << ResultDimensionalExponents->getLuminousIntensityExponent() << std::endl);
	TEST_ASSERT(ResultDimensionalExponents->getLuminousIntensityExponent()==14);

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

	return failure_results;
}
Пример #12
0
int main ()
{
  Arrangement_2   arr;
  Point_2         ps[N_POINTS];
  Vertex_handle   vhs[N_POINTS];
  bool            valid;
  int             k;

  ps[0] = Point_2 (2, 2);
  ps[1] = Point_2 (2, 7);
  ps[2] = Point_2 (4, 9);
  ps[3] = Point_2 (4, 5);
  ps[4] = Point_2 (5, 3);
  ps[5] = Point_2 (7, 1);
  ps[6] = Point_2 (7, 5);
  ps[7] = Point_2 (7, 7);
  ps[8] = Point_2 (9, 3);
  ps[9] = Point_2 (9, 6);

  for (k = 0; k < N_POINTS; k++)
  {
    vhs[k] = insert_point (arr, ps[k]);
  }

  arr.insert_from_left_vertex (Segment_2 (Point_2 (2, 7), Point_2 (4, 7)),
                               vhs[1]);
  TEST_VALIDITY(1);

  arr.insert_from_right_vertex (Segment_2 (Point_2 (6, 6), Point_2 (7, 5)),
                                vhs[6]);
  TEST_VALIDITY(2);

  arr.insert_at_vertices (Segment_2 (Point_2 (7, 1), Point_2 (9, 3)),
                          vhs[5], vhs[8]);
  TEST_VALIDITY(3);

  arr.insert_at_vertices (Segment_2 (Point_2 (7, 5), Point_2 (9, 3)),
                          vhs[6], vhs[8]);
  TEST_VALIDITY(4);

  arr.insert_from_right_vertex (Segment_2 (Point_2 (1, 1), Point_2 (2, 7)),
                                vhs[1]);
  TEST_VALIDITY(5);

  insert_non_intersecting_curve (arr,
                                 Segment_2 (Point_2 (1, 1), Point_2 (7, 1)));
  TEST_VALIDITY(6);

  insert_non_intersecting_curve (arr,
                                 Segment_2 (Point_2 (4, 7), Point_2 (6, 6)));
  TEST_VALIDITY(7);
  
  insert_non_intersecting_curve (arr,
                                 Segment_2 (Point_2 (2, 7), Point_2 (3, 3)));
  TEST_VALIDITY(8);

  insert_non_intersecting_curve (arr,
                                 Segment_2 (Point_2 (3, 3), Point_2 (7, 1)));
  TEST_VALIDITY(9);

  arr.insert_at_vertices (Segment_2 (Point_2 (7, 5), Point_2 (9, 6)),
                          vhs[6], vhs[9]);
  TEST_VALIDITY(10);

  std::cout << "Arrangement size:"
            << "   V = " << arr.number_of_vertices()
            << " (" << arr.number_of_isolated_vertices() << " isolated)"
            << ",  E = " << arr.number_of_edges() 
            << ",  F = " << arr.number_of_faces() << std::endl;
   
  // Check the validity more thoroughly.
  valid = is_valid(arr);
  std::cout << "Arrangement is "
            << (valid ? "valid." : "NOT valid!") << std::endl;

  return (0);
}
Пример #13
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);

///////////////////////////////////////////////////////////////////////////////////////////
	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;
}
Пример #14
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::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;
}
Пример #15
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::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;
}
Пример #16
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);

	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;
}
Пример #17
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::IfcStructuralLinearActionVarying > StructuralLinearActionVarying = eds->createIfcStructuralLinearActionVarying();
	TEST_ASSERT(StructuralLinearActionVarying->getVaryingAppliedLoads().empty());

	Step::RefPtr< ifc2x3::IfcShapeAspect > ShapeAspect = eds->createIfcShapeAspect();
	TEST_VALIDITY(ShapeAspect);
	Step::RefPtr< ifc2x3::IfcShapeModel > ShapeModelRepresentation1 = eds->createIfcShapeRepresentation();
	Step::RefPtr< ifc2x3::IfcShapeModel > ShapeModelRepresentation2 = eds->createIfcShapeRepresentation();
	ShapeAspect->getShapeRepresentations().push_back(ShapeModelRepresentation1);
	ShapeAspect->getShapeRepresentations().push_back(ShapeModelRepresentation2);
	ShapeAspect->setName("ShapeAspect");
	ShapeAspect->setDescription("IfcShapeAspect");
	ShapeAspect->setProductDefinitional(Step::LTrue);
	Step::RefPtr< ifc2x3::IfcProductDefinitionShape > ProductDefinitionShape = eds->createIfcProductDefinitionShape();
	ShapeAspect->setPartOfProductDefinitionShape(ProductDefinitionShape);
	StructuralLinearActionVarying->setVaryingAppliedLoadLocation(ShapeAspect);

	Step::RefPtr< ifc2x3::IfcStructuralLoad > StructuralLoad1 = eds->createIfcStructuralLoadLinearForce();
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> > (StructuralLoad1)->setLinearForceX(1);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> > (StructuralLoad1)->setLinearForceY(1);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> > (StructuralLoad1)->setLinearForceZ(1);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> > (StructuralLoad1)->setLinearMomentX(1);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> > (StructuralLoad1)->setLinearMomentY(1);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> > (StructuralLoad1)->setLinearMomentZ(1);
	StructuralLinearActionVarying->getSubsequentAppliedLoads().push_back(StructuralLoad1);

	Step::RefPtr< ifc2x3::IfcStructuralLoad > StructuralLoad2 = eds->createIfcStructuralLoadPlanarForce();
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadPlanarForce> > (StructuralLoad2)->setPlanarForceX(2);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadPlanarForce> > (StructuralLoad2)->setPlanarForceY(2);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadPlanarForce> > (StructuralLoad2)->setPlanarForceZ(2);
	StructuralLinearActionVarying->getSubsequentAppliedLoads().push_back(StructuralLoad2);
	Step::RefPtr< ifc2x3::IfcStructuralLoad > StructuralLoad3 = eds->createIfcStructuralLoadSingleDisplacement();
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadSingleDisplacement> > (StructuralLoad3)->setDisplacementX(3);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadSingleDisplacement> > (StructuralLoad3)->setDisplacementY(3);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadSingleDisplacement> > (StructuralLoad3)->setDisplacementZ(3);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadSingleDisplacement> > (StructuralLoad3)->setRotationalDisplacementRX(3);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadSingleDisplacement> > (StructuralLoad3)->setRotationalDisplacementRY(3);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadSingleDisplacement> > (StructuralLoad3)->setRotationalDisplacementRZ(3);
	StructuralLinearActionVarying->getSubsequentAppliedLoads().push_back(StructuralLoad3);
	Step::RefPtr< ifc2x3::IfcStructuralLoad > StructuralLoad4 = eds->createIfcStructuralLoadSingleForce();
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadSingleForce> > (StructuralLoad4)->setForceX(4);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadSingleForce> > (StructuralLoad4)->setForceY(4);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadSingleForce> > (StructuralLoad4)->setForceZ(4);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadSingleForce> > (StructuralLoad4)->setMomentX(4);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadSingleForce> > (StructuralLoad4)->setMomentY(4);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadSingleForce> > (StructuralLoad4)->setMomentZ(4);
	StructuralLinearActionVarying->getSubsequentAppliedLoads().push_back(StructuralLoad4);
	Step::RefPtr< ifc2x3::IfcStructuralLoad > StructuralLoad5 = eds->createIfcStructuralLoadTemperature();
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadTemperature> > (StructuralLoad5)->setDeltaT_Constant(5);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadTemperature> > (StructuralLoad5)->setDeltaT_Y(5);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadTemperature> > (StructuralLoad5)->setDeltaT_Z(5);
	StructuralLinearActionVarying->getSubsequentAppliedLoads().push_back(StructuralLoad5);

	ifc2x3::List_IfcStructuralLoad_2_n ListIfcStructuralLoad = StructuralLinearActionVarying->getVaryingAppliedLoads();
	if(dynamic_cast<ifc2x3::IfcStructuralLoadLinearForce* > (ListIfcStructuralLoad[0].get()))
	{	
		Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> StructuralLoadLinearForce = static_cast<ifc2x3::IfcStructuralLoadLinearForce* > (ListIfcStructuralLoad[0].get());
		TEST_ASSERT(StructuralLoadLinearForce->getLinearForceX()==1);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearForceY()==1);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearForceZ()==1);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearMomentX()==1);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearMomentY()==1);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearMomentZ()==1);
	}
	if(dynamic_cast<ifc2x3::IfcStructuralLoadPlanarForce* > (ListIfcStructuralLoad[1].get()))
	{	
		Step::RefPtr<ifc2x3::IfcStructuralLoadPlanarForce> StructuralLoadPlanarForce = static_cast<ifc2x3::IfcStructuralLoadPlanarForce* > (ListIfcStructuralLoad[1].get());
		TEST_ASSERT(StructuralLoadPlanarForce->getPlanarForceX()==2);
		TEST_ASSERT(StructuralLoadPlanarForce->getPlanarForceY()==2);
		TEST_ASSERT(StructuralLoadPlanarForce->getPlanarForceZ()==2);

	}
	if(dynamic_cast<ifc2x3::IfcStructuralLoadSingleDisplacement* > (ListIfcStructuralLoad[2].get()))
	{	
		Step::RefPtr<ifc2x3::IfcStructuralLoadSingleDisplacement> StructuralLoadSingleDisplacement = static_cast<ifc2x3::IfcStructuralLoadSingleDisplacement* > (ListIfcStructuralLoad[2].get());
		TEST_ASSERT(StructuralLoadSingleDisplacement->getDisplacementX()==3);
		TEST_ASSERT(StructuralLoadSingleDisplacement->getDisplacementY()==3);
		TEST_ASSERT(StructuralLoadSingleDisplacement->getDisplacementZ()==3);
		TEST_ASSERT(StructuralLoadSingleDisplacement->getRotationalDisplacementRX()==3);
		TEST_ASSERT(StructuralLoadSingleDisplacement->getRotationalDisplacementRY()==3);
		TEST_ASSERT(StructuralLoadSingleDisplacement->getRotationalDisplacementRZ()==3);
	}
	if(dynamic_cast<ifc2x3::IfcStructuralLoadSingleForce* > (ListIfcStructuralLoad[3].get()))
	{	
		Step::RefPtr<ifc2x3::IfcStructuralLoadSingleForce> StructuralLoadSingleForce = static_cast<ifc2x3::IfcStructuralLoadSingleForce* > (ListIfcStructuralLoad[3].get());
		TEST_ASSERT(StructuralLoadSingleForce->getForceX()==4);
		TEST_ASSERT(StructuralLoadSingleForce->getForceY()==4);
		TEST_ASSERT(StructuralLoadSingleForce->getForceZ()==4);
		TEST_ASSERT(StructuralLoadSingleForce->getMomentX()==4);
		TEST_ASSERT(StructuralLoadSingleForce->getMomentY()==4);
		TEST_ASSERT(StructuralLoadSingleForce->getMomentZ()==4);
	}
	if(dynamic_cast<ifc2x3::IfcStructuralLoadTemperature* > (ListIfcStructuralLoad[4].get()))
	{	
		Step::RefPtr<ifc2x3::IfcStructuralLoadTemperature> StructuralLoadTemperature = static_cast<ifc2x3::IfcStructuralLoadTemperature* > (ListIfcStructuralLoad[4].get());
		TEST_ASSERT(StructuralLoadTemperature->getDeltaT_Constant()==5);
		TEST_ASSERT(StructuralLoadTemperature->getDeltaT_Y()==5);
		TEST_ASSERT(StructuralLoadTemperature->getDeltaT_Z()==5);
	}

	Step::RefPtr< ifc2x3::IfcStructuralLoad > StructuralAppliedLoad = eds->createIfcStructuralLoadLinearForce();
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> > (StructuralAppliedLoad)->setLinearForceX(0);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> > (StructuralAppliedLoad)->setLinearForceY(0);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> > (StructuralAppliedLoad)->setLinearForceZ(0);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> > (StructuralAppliedLoad)->setLinearMomentX(0);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> > (StructuralAppliedLoad)->setLinearMomentY(0);
	static_cast<Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> > (StructuralAppliedLoad)->setLinearMomentZ(0);
	StructuralLinearActionVarying->setAppliedLoad(StructuralAppliedLoad);

	ListIfcStructuralLoad = StructuralLinearActionVarying->getVaryingAppliedLoads();
	if(dynamic_cast<ifc2x3::IfcStructuralLoadLinearForce* > (ListIfcStructuralLoad[0].get()))
	{	
		Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> StructuralLoadLinearForce = static_cast<ifc2x3::IfcStructuralLoadLinearForce* > (ListIfcStructuralLoad[0].get());
		TEST_ASSERT(StructuralLoadLinearForce->getLinearForceX()==0);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearForceY()==0);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearForceZ()==0);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearMomentX()==0);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearMomentY()==0);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearMomentZ()==0);
	}
	if(dynamic_cast<ifc2x3::IfcStructuralLoadLinearForce* > (ListIfcStructuralLoad[1].get()))
	{	
		Step::RefPtr<ifc2x3::IfcStructuralLoadLinearForce> StructuralLoadLinearForce = static_cast<ifc2x3::IfcStructuralLoadLinearForce* > (ListIfcStructuralLoad[1].get());
		TEST_ASSERT(StructuralLoadLinearForce->getLinearForceX()==1);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearForceY()==1);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearForceZ()==1);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearMomentX()==1);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearMomentY()==1);
		TEST_ASSERT(StructuralLoadLinearForce->getLinearMomentZ()==1);
	}
	if(dynamic_cast<ifc2x3::IfcStructuralLoadPlanarForce* > (ListIfcStructuralLoad[2].get()))
	{	
		Step::RefPtr<ifc2x3::IfcStructuralLoadPlanarForce> StructuralLoadPlanarForce = static_cast<ifc2x3::IfcStructuralLoadPlanarForce* > (ListIfcStructuralLoad[2].get());
		TEST_ASSERT(StructuralLoadPlanarForce->getPlanarForceX()==2);
		TEST_ASSERT(StructuralLoadPlanarForce->getPlanarForceY()==2);
		TEST_ASSERT(StructuralLoadPlanarForce->getPlanarForceZ()==2);

	}
	if(dynamic_cast<ifc2x3::IfcStructuralLoadSingleDisplacement* > (ListIfcStructuralLoad[3].get()))
	{	
		Step::RefPtr<ifc2x3::IfcStructuralLoadSingleDisplacement> StructuralLoadSingleDisplacement = static_cast<ifc2x3::IfcStructuralLoadSingleDisplacement* > (ListIfcStructuralLoad[3].get());
		TEST_ASSERT(StructuralLoadSingleDisplacement->getDisplacementX()==3);
		TEST_ASSERT(StructuralLoadSingleDisplacement->getDisplacementY()==3);
		TEST_ASSERT(StructuralLoadSingleDisplacement->getDisplacementZ()==3);
		TEST_ASSERT(StructuralLoadSingleDisplacement->getRotationalDisplacementRX()==3);
		TEST_ASSERT(StructuralLoadSingleDisplacement->getRotationalDisplacementRY()==3);
		TEST_ASSERT(StructuralLoadSingleDisplacement->getRotationalDisplacementRZ()==3);
	}
	if(dynamic_cast<ifc2x3::IfcStructuralLoadSingleForce* > (ListIfcStructuralLoad[4].get()))
	{	
		Step::RefPtr<ifc2x3::IfcStructuralLoadSingleForce> StructuralLoadSingleForce = static_cast<ifc2x3::IfcStructuralLoadSingleForce* > (ListIfcStructuralLoad[4].get());
		TEST_ASSERT(StructuralLoadSingleForce->getForceX()==4);
		TEST_ASSERT(StructuralLoadSingleForce->getForceY()==4);
		TEST_ASSERT(StructuralLoadSingleForce->getForceZ()==4);
		TEST_ASSERT(StructuralLoadSingleForce->getMomentX()==4);
		TEST_ASSERT(StructuralLoadSingleForce->getMomentY()==4);
		TEST_ASSERT(StructuralLoadSingleForce->getMomentZ()==4);
	}
	if(dynamic_cast<ifc2x3::IfcStructuralLoadTemperature* > (ListIfcStructuralLoad[5].get()))
	{	
		Step::RefPtr<ifc2x3::IfcStructuralLoadTemperature> StructuralLoadTemperature = static_cast<ifc2x3::IfcStructuralLoadTemperature* > (ListIfcStructuralLoad[5].get());
		TEST_ASSERT(StructuralLoadTemperature->getDeltaT_Constant()==5);
		TEST_ASSERT(StructuralLoadTemperature->getDeltaT_Y()==5);
		TEST_ASSERT(StructuralLoadTemperature->getDeltaT_Z()==5);
	}

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

	return failure_results;
}
Пример #18
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);

    // Create a wall
    Step::RefPtr<ifc2x3::IfcWallStandardCase> theWall = eds->createIfcWallStandardCase();

    // Create a product representation
    Step::RefPtr<ifc2x3::IfcProductRepresentation> representation1 = eds->createIfcProductRepresentation();
    // Set this product representation to the wall
    theWall->setRepresentation(representation1.get());
    // Get the product representation from the wall
    Step::RefPtr<ifc2x3::IfcProductRepresentation> representation1_get = theWall->getRepresentation();
    // Test if it is valid
    TEST_VALIDITY(representation1_get);

    // Now same test with the a product definition shape
    Step::RefPtr<ifc2x3::IfcProductDefinitionShape> representation2 = eds->createIfcProductDefinitionShape();
    theWall->setRepresentation(representation2.get());
    Step::RefPtr<ifc2x3::IfcProductDefinitionShape> representation2_get = (ifc2x3::IfcProductDefinitionShape*) theWall->getRepresentation();
    TEST_VALIDITY(representation2_get);
    if (representation2_get.valid())
    {
        // test the inverse
        TEST_ASSERT(*representation2_get->getShapeOfProduct().begin() == theWall.get());
    }

    // One more time to test the inverse
    Step::RefPtr<ifc2x3::IfcProductDefinitionShape> representation3 = eds->createIfcProductDefinitionShape();
    theWall->setRepresentation(representation3.get());
    Step::RefPtr<ifc2x3::IfcProductDefinitionShape> representation3_get = (ifc2x3::IfcProductDefinitionShape*) theWall->getRepresentation();
    TEST_VALIDITY(representation3_get);
    if (representation2_get.valid())
    {
        // test the inverse
        TEST_ASSERT(representation2_get->getShapeOfProduct().empty());
    }
    if (representation3_get.valid())
    {
        // test the inverse
        TEST_ASSERT(*representation3_get->getShapeOfProduct().begin() == theWall.get());
    }

    // And a last one
    theWall->setRepresentation(representation1.get());
    // Get the product representation from the wall
    representation1_get = theWall->getRepresentation();
    // Test if it is valid
    TEST_VALIDITY(representation1_get);
    if (representation2_get.valid())
    {
        // test the inverse
        TEST_ASSERT(representation2_get->getShapeOfProduct().empty());
    }
    if (representation3_get.valid())
    {
        // test the inverse
        TEST_ASSERT(representation3_get->getShapeOfProduct().empty());
    }

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

    return failure_results;
}
Пример #19
0
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;
}
Пример #20
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::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;
}
Пример #21
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::IfcTable > Table = eds->createIfcTable();
	TEST_VALIDITY(Table);

	TEST_ASSERT(Table->getNumberOfCellsInRow()==0);
	TEST_ASSERT(Table->getNumberOfHeadings()==0);
	TEST_ASSERT(Table->getNumberOfDataRows()==0);
	
	Table->setName("Table");
	Step::RefPtr< ifc2x3::IfcTableRow > TableRow1 = eds->createIfcTableRow();
	Step::RefPtr< ifc2x3::IfcValue > Value = new ifc2x3::IfcValue();
	Value->setIfcVolumeMeasure(0.0);
	TableRow1->getRowCells().push_back(Value);
	Value->setIfcVolumeMeasure(1.0);
	TableRow1->getRowCells().push_back(Value);
	Value->setIfcVolumeMeasure(2.0);
	TableRow1->getRowCells().push_back(Value);
	TableRow1->setIsHeading(Step::BTrue);
	Table->getRows().push_back(TableRow1);
	LOG_DEBUG("Table->getNumberOfCellsInRow()=" << Table->getNumberOfCellsInRow() << std::endl);
	TEST_ASSERT(Table->getNumberOfCellsInRow()==3);
	LOG_DEBUG("Table->getNumberOfHeadings()=" << Table->getNumberOfHeadings() << std::endl);
	TEST_ASSERT(Table->getNumberOfHeadings()==1);
	LOG_DEBUG("Table->getNumberOfDataRows()=" << Table->getNumberOfDataRows() << std::endl);
	TEST_ASSERT(Table->getNumberOfDataRows()==0);

	Step::RefPtr< ifc2x3::IfcTableRow > TableRow2 = eds->createIfcTableRow();
	Value->setIfcVolumeMeasure(3.0);
	TableRow2->getRowCells().push_back(Value);
	Value->setIfcVolumeMeasure(4.0);
	TableRow2->getRowCells().push_back(Value);
	Value->setIfcVolumeMeasure(5.0);
	TableRow2->getRowCells().push_back(Value);
	TableRow2->setIsHeading(Step::BFalse);
	Table->getRows().push_back(TableRow2);
	LOG_DEBUG("Table->getNumberOfCellsInRow()=" << Table->getNumberOfCellsInRow() << std::endl);
	TEST_ASSERT(Table->getNumberOfCellsInRow()==3);
	LOG_DEBUG("Table->getNumberOfHeadings()=" << Table->getNumberOfHeadings() << std::endl);
	TEST_ASSERT(Table->getNumberOfHeadings()==1);
	LOG_DEBUG("Table->getNumberOfDataRows()=" << Table->getNumberOfDataRows() << std::endl);
	TEST_ASSERT(Table->getNumberOfDataRows()==1);
	Step::RefPtr< ifc2x3::IfcTableRow > TableRow3 = eds->createIfcTableRow();
	Value->setIfcVolumeMeasure(6.0);
	TableRow3->getRowCells().push_back(Value);
	Value->setIfcVolumeMeasure(7.0);
	TableRow3->getRowCells().push_back(Value);
	Value->setIfcVolumeMeasure(8.0);
	TableRow3->getRowCells().push_back(Value);
	TableRow3->setIsHeading(Step::BTrue);
	Table->getRows().push_back(TableRow3);
	LOG_DEBUG("Table->getNumberOfCellsInRow()=" << Table->getNumberOfCellsInRow() << std::endl);
	TEST_ASSERT(Table->getNumberOfCellsInRow()==3);
	LOG_DEBUG("Table->getNumberOfHeadings()=" << Table->getNumberOfHeadings() << std::endl);
	TEST_ASSERT(Table->getNumberOfHeadings()==2);
	LOG_DEBUG("Table->getNumberOfDataRows()=" << Table->getNumberOfDataRows() << std::endl);
	TEST_ASSERT(Table->getNumberOfDataRows()==1);

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

	return failure_results;
}