ciao.
ho la seguente classe:
quando dichiaro una variabile ad es in questa classe:codice:class IFC2X3_DLL_DEF IfcObjectPlacement : public Step::BaseEntity { public: /** * Accepts a read/write Step::BaseVisitor. * * @param visitor the read/write Step::BaseVisitor to accept */ virtual bool acceptVisitor(Step::BaseVisitor *visitor); /** * Returns the class type as a human readable std::string. * */ virtual const std::string &type() const; /** * Returns the Step::ClassType of this specific class. Useful to compare with the isOfType method for example. * */ static const Step::ClassType &getClassType(); /** * Returns the Step::ClassType of the instance of this class. (might be a subtype since it is virtual and overloaded). * */ virtual const Step::ClassType &getType() const; /** * Compares this instance's Step::ClassType with the one passed as parameter. Checks the type recursively (to the mother classes). * * @param t */ virtual bool isOfType(const Step::ClassType &t) const; /** * Gets the value of the inverse attribute 'PlacesObject'. * MM 2009/09/07 change to correct a bug that will be resolved in 2x4 */ Inverse_Set_IfcProduct_1_n &getPlacesObject(); /** * (const) Returns the value of the explicit attribute 'PlacesObject'. * * @return the value of the explicit attribute 'PlacesObject' */ virtual const Inverse_Set_IfcProduct_1_n &getPlacesObject() const; /** * Test if the attribute 'PlacesObject' is set. * MM 2009/09/07 change to correct a bug that will be resolved in 2x4 * @return true if set, false if unset */ virtual bool testPlacesObject() const; /** * Gets the value of the inverse attribute 'ReferencedByPlacements'. * */ Inverse_Set_IfcLocalPlacement_0_n &getReferencedByPlacements(); /** * (const) Returns the value of the explicit attribute 'ReferencedByPlacements'. * * @return the value of the explicit attribute 'ReferencedByPlacements' */ virtual const Inverse_Set_IfcLocalPlacement_0_n &getReferencedByPlacements() const; /** * Test if the attribute 'ReferencedByPlacements' is set. * * @return true if set, false if unset */ virtual bool testReferencedByPlacements() const; friend class IfcLocalPlacement; friend class IfcProduct; friend class ExpressDataSet; protected: /** * @param id * @param args */ IfcObjectPlacement(Step::Id id, Step::SPFData *args); virtual ~IfcObjectPlacement(); /** */ virtual bool init(); /** * @param obj * @param copyop */ virtual void copy(const IfcObjectPlacement &obj, const CopyOp ©op); private: /** */ static Step::ClassType s_type; /** * MM 2009/09/07 change to correct a bug that will be resolved in 2x4 */ Inverse_Set_IfcProduct_1_n m_placesObject; /** */ Inverse_Set_IfcLocalPlacement_0_n m_referencedByPlacements; };
codice:#pragma once #include <ifc2x3/ifc2x3DLL.h> #include <ifc2x3/IfcLocalPlacement.h> #include <ifc2x3/3DVectorIfc.h> #include <ifc2x3/3DMatrixIfc.h> #include <Step/BaseObject.h> class IFC2X3_DLL_DEF CIfcTrasformation { public: CIfcTrasformation(void); ~CIfcTrasformation(void); //ritorna la matrice di rotazione 3x3 e il vettore di translazione dal IfcLocalPlacement int GetPositionAndRotation(const Step::RefPtr<ifc2x3::IfcLocalPlacement>& pPlacement, C3DVectorIfc& position, C3DMatrixIfc& matrix ); int MultiplyPositionForParent(const Step::RefPtr<ifc2x3::IfcLocalPlacement>& ParentPlacement); private: ifc2x3::IfcLocalPlacement m_LocalPlacement; // oggetto che contiene matrici di rotazione e posizione C3DVectorIfc m_Position; //vettore con translazione C3DMatrixIfc m_RotationMatix;//matrice di rotazione };
ifc2x3::IfcLocalPlacement m_LocalPlacement; // oggetto che contiene matrici di rotazione e posizione
mi da questi errori:
c:\ifc\project\src\ifc2x3\IfcTrasformation.cpp(15) : error C2248: 'ifc2x3::IfcLocalPlacement::~IfcLocalPlacement' : cannot access protected member declared in class 'ifc2x3::IfcLocalPlacement'
C:\ifc\include\ifc2x3\IfcLocalPlacement.h(131) : see declaration of 'ifc2x3::IfcLocalPlacement::~IfcLocalPlacement'
C:\ifc\include\ifc2x3\IfcLocalPlacement.h(38) : see declaration of 'ifc2x3::IfcLocalPlacement'
c:\ifc\project\src\ifc2x3\IfcTrasformation.cpp(11) : error C2512: 'ifc2x3::IfcLocalPlacement' : no appropriate default constructor available
come poso risolvere e a cosa servono i costruttori protetti?
da quello che ho capito posso dichiarare una variabile o un puntatore solo all interno della gerarchia di ereditarietà di cui fa parte IfcLocalPlacement, ma perchè?

Rispondi quotando