///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
// All rights reserved.
//
// This software and its documentation and related materials are owned by
// the Alliance. The software may only be incorporated into application
// programs owned by members of the Alliance, subject to a signed
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable
// trade secrets of the Alliance and its suppliers. The software is also
// protected by copyright law and international treaty provisions. Application
// programs incorporating this software must include the following statement
// with their copyright notices:
//
// This application incorporates Open Design Alliance software pursuant to a license
// agreement with Open Design Alliance.
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
// All rights reserved.
//
// By use of this software, its documentation or related materials, you
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
// IfcSegmentedReferenceCurve.h: interface for the OdIfcSegmentedReferenceCurve class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(ODA_ODIFCSEGMENTEDREFERENCECURVE_H_INCLUDED_)
#define ODA_ODIFCSEGMENTEDREFERENCECURVE_H_INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "IfcCompositeCurve.h"
#include "IfcCurveSegment.h"
#include "Ge/GeCompositeCurve3d.h"
#include "TD_PackPush.h"
/** \details
Contains declarations related to working with IFC files content.
*/
namespace OdIfc {
/** \details
A base class that implements storing and handling data about an IfcSegmentedReferenceCurve.
An IfcSegmentedReferenceCurve is defined in the linear parameter space of the base curve.
The base curve is a positioning basis for the occurrences of the OdIfcCurveSegment collection.
The curve segment deviating explicit position defines a depression or elevation from the base curve axis.
*/
class IFCGEOM_EXPORT OdIfcSegmentedReferenceCurve : public OdIfcCompositeCurve
{
ODRX_DECLARE_MEMBERS(OdIfcSegmentedReferenceCurve);
public:
/** \details
Composes the IfcSegmentedReferenceCurve object.
*/
virtual void compose();
/** \details
Retrieves the cant matrix of the IfcSegmentedReferenceCurve object.
\param length [in] A length value.
\param matrix [out] A placeholder for an OdGeMatrix3d object that represents the cant matrix.
\param withRotation [in] A flag that determines whether the matrix is returned with a specified rotation (equals true) or not (equals false). By default, equals true.
\param rotPoint [in] A rotation center point represented with an OdGePoint3d object.
\param rotVector [in] An OdGeVector3d object that represents the rotation vector.
\param profileIn2d [in] A value of the profiling in a 2D projection flag. By default, equals true.
\returns eOk if the cant matrix was successfully returned to the calling subroutine; otherwise, the method returns an appropriate error code.
*/
virtual OdResult getCantMatrix(double length, OdGeMatrix3d& matrix, bool withRotation = true, const OdGePoint3d& rotPoint = OdGePoint3d(0, 0, 0), const OdGeVector3d& rotVector = OdGeVector3d(0, 0, 1), bool profileIn2d = true) const;
/** \details
A handler that processes the start of the curve creation event.
\returns eOk if the curve creation event was successfully processed; otherwise, the method returns an appropriate error code.
*/
virtual OdResult onStartCurveCreating();
/** \details
Calculates the full parametric length of the IfcSegmentedReferenceCurve object.
\returns A double value that contains the full parametric length.
*/
double parametricLength();
/** \details
Retrieves a function graph of curvatures for the underlying segment curves.
\param numSegments [in] A number of segments for the approximation.
\param cantValues [out] An array of 2-dimensional approximation points (parameter value, cant value).
\returns eOk if cant values were calculated successfully; otherwise, the method returns an appropiate error code.
*/
OdResult getCantValues(int numSegments, OdGePoint2dArray &cantValues);
private:
OdGePoint3d moveAlongCurve(OdIfcCurveSegmentPtr pSeg, const OdGePoint3d* pLocation, double param) const;
bool getPlacementVectors(OdIfcCurveSegment* pSeg, const OdGePoint3d*& pLocation, const OdGeVector3d*& pDirection, const OdGeVector3d*& pAxis) const;
mutable OdDAIObjectId* m_pSeg = nullptr;
OdDAIObjectIds m_Segments;
};
SMARTPTR(OdIfcSegmentedReferenceCurve);
}
#include "TD_PackPop.h"
#endif // !defined(ODA_ODIFCSEGMENTEDREFERENCECURVE_H_INCLUDED_)