///////////////////////////////////////////////////////////////////////////////
// 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.
///////////////////////////////////////////////////////////////////////////////
#ifndef _IFC_CURVE_H_
#define _IFC_CURVE_H_
#include "Ge/GePolyline3d.h"
#include "Ge/GeCircArc3d.h"
#include "Ge/GeEllipArc3d.h"
#include "Ge/GeLineSeg3d.h"
#include "Ge/GeCompositeCurve3d.h"
#include "IfcGeometricRepresentationItem.h"
#include "TD_PackPush.h"
/** \details
Contains declarations related to working with IFC file content.
*/
namespace OdIfc {
/** \details
A base class that implements storing and handling data about a definition of an IfcCurve.
*/
class IFCGEOM_EXPORT OdIfcCurve : public OdIfcGeometricRepresentationItem
{
//DOM-IGNORE-BEGIN
ODRX_DECLARE_MEMBERS(OdIfcCurve);
//DOM-IGNORE-END
public:
/** \details
Retrieves the identifier of an underlying Ge curve.
\returns An object that contains the underlaying Ge curve identifier.
*/
virtual OdGe::EntityId entityId() const { ODA_ASSERT_ONCE(m_pCurve); return m_pCurve ? m_pCurve->type() : OdGe::kInvalidEntity; }
/** \details
Returns a copy of the underlying Ge curve.
\returns A raw pointer to the OdGeCurve3d object that represents the copy of the underlaying Ge curve.
*/
virtual OdGeCurve3d* getGeCurveCopy() const { ODA_ASSERT_ONCE(m_pCurve); return m_pCurve ? static_cast(m_pCurve->copy()) : nullptr; }
/** \details
Retrieves the underlaying Ge curve object in read-only mode.
\returns A constant raw pointer to the underlying Ge curve represented with an OdGeCurve3d object.
*/
const OdGeCurve3d* getGeCurve() const { ODA_ASSERT_ONCE(m_pCurve); return m_pCurve.get(); }
/** \details
Applies the specified transformation to the object.
\param transform [in] A transformation matrix to be applied.
\returns eOk value if the transformation operation was successful; otherwise, the method returns an appropriate error code.
*/
OdResult transformBy(const OdGeMatrix3d &transform) override;
/** \details
Retrieves parameter value by provided curve length.
\param length [in] Length from the curve start.
\returns Parameter value along the curve.
*/
virtual double paramAtLength(double length) const;
/** \details
Calculates position and first derivative of the curve by parameter value.
\param param [in] Parameter value.
\param derivs [out] An OdGeVector3dArray which contains first derivative of the curve in parameter.
\returns Position on the curve as OdGePoint3d instance.
*/
virtual OdGePoint3d evalPoint(double param, OdGeVector3dArray &derivs) const;
/** \details
Defines whether the curve is a 3D object.
\returns true if the curve is a 3D object; otherwise, the method returns false.
*/
inline virtual bool is3d() const { return m_is3d; }
/** \details
Sets a new value of the 3D flag for the curve.
3D flag determines whether the curve is a 3D object (if it equals true) or not (in this case the flag value equals false).
\param val [in] A new value of the flag to be set.
*/
inline void setIs3d(bool val) { m_is3d = val; }
/** \details
Returns value that determines should curve weight be applied during drawing.
\returns true because the curve weight in style should be applied during render.
*/
bool getUseCurveWeight() const override;
/** \details
Returns value that determines should curve color be applied during drawing.
\returns true because the curve color in style should be applied during render.
*/
bool getUseCurveColor() const override;
//DOM-IGNORE-BEGIN
protected:
OdGeMatrix3d m_transform;
OdGeCurve3dPtr m_pCurve;
void getMatrix(OdIfcInstancePtr pPosition, OdGeMatrix3d& matr);
private:
bool m_is3d;
//DOM-IGNORE-END
};
/** \details
A data type that represents a smart pointer to an OdIfcCurve object.
*/
typedef OdSmartPtr OdIfcCurvePtr;
} // namespace
#include "TD_PackPop.h"
#endif // _IFC_CURVE_H_