diff --git a/src/GDTFManager.cpp b/src/GDTFManager.cpp index 1431fccf..6d3c762a 100644 --- a/src/GDTFManager.cpp +++ b/src/GDTFManager.cpp @@ -1153,6 +1153,10 @@ GdtfWheelSlot::GdtfWheelSlot(GdtfWheel* parent) fWheelParent = parent; fFilter = nullptr; fAnimationSystem = nullptr; + fDuration = 0.0; + fWidth = 0; + fHeight = 0; + fFPS = 0; } GdtfWheelSlot::GdtfWheelSlot(const TXString& name, GdtfWheel* parent) @@ -1161,6 +1165,10 @@ GdtfWheelSlot::GdtfWheelSlot(const TXString& name, GdtfWheel* parent) fWheelParent = parent; fFilter = nullptr; fAnimationSystem = nullptr; + fDuration = 0.0; + fWidth = 0; + fHeight = 0; + fFPS = 0; } @@ -1270,6 +1278,10 @@ void GdtfWheelSlot::OnPrintToFile(IXMLFileNodePtr pNode) pNode->SetNodeAttributeValue(XML_GDTF_WheelSlotColor, GdtfConverter::ConvertColor(fColor)); if(fGobo != "") { pNode->SetNodeAttributeValue(XML_GDTF_WheelSlotPicture, fGobo); } if(fFilter) { pNode->SetNodeAttributeValue(XML_GDTF_WheelSlotFilter, fFilter->GetNodeReference()); } + if(fDuration != 0.0) { pNode->SetNodeAttributeValue(XML_GDTF_WheelSlotDuration, GdtfConverter::ConvertDouble(fDuration)); } + if(fWidth != 0) { pNode->SetNodeAttributeValue(XML_GDTF_WheelSlotWidth, GdtfConverter::ConvertInteger(fWidth)); } + if(fHeight != 0) { pNode->SetNodeAttributeValue(XML_GDTF_WheelSlotHeight, GdtfConverter::ConvertInteger(fHeight)); } + if(fFPS != 0) { pNode->SetNodeAttributeValue(XML_GDTF_WheelSlotFPS, GdtfConverter::ConvertInteger(fFPS)); } //------------------------------------------------------------------------------------ // Print the children @@ -1311,6 +1323,16 @@ void GdtfWheelSlot::OnReadFromNode(const IXMLFileNodePtr& pNode) pNode->GetNodeAttributeValue(XML_GDTF_WheelSlotFilter, fUnresolvedFilter); + + TXString duration, width, height, fps; + pNode->GetNodeAttributeValue(XML_GDTF_WheelSlotDuration, duration); + pNode->GetNodeAttributeValue(XML_GDTF_WheelSlotWidth, width); + pNode->GetNodeAttributeValue(XML_GDTF_WheelSlotHeight, height); + pNode->GetNodeAttributeValue(XML_GDTF_WheelSlotFPS, fps); + if(!duration.IsEmpty()) { GdtfConverter::ConvertDouble(duration, pNode, fDuration); } + if(!width.IsEmpty()) { GdtfConverter::ConvertInteger(width, pNode, fWidth); } + if(!height.IsEmpty()) { GdtfConverter::ConvertInteger(height, pNode, fHeight); } + if(!fps.IsEmpty()) { GdtfConverter::ConvertInteger(fps, pNode, fFPS); } //------------------------------------------------------------------------------------ // Read the wheel slots @@ -1358,6 +1380,10 @@ void GdtfWheelSlot::OnErrorCheck(const IXMLFileNodePtr& pNode) optional.push_back(XML_GDTF_WheelSlotColor); optional.push_back(XML_GDTF_WheelSlotPicture); optional.push_back(XML_GDTF_WheelSlotFilter); + optional.push_back(XML_GDTF_WheelSlotDuration); + optional.push_back(XML_GDTF_WheelSlotWidth); + optional.push_back(XML_GDTF_WheelSlotHeight); + optional.push_back(XML_GDTF_WheelSlotFPS); //------------------------------------------------------------------------------------ @@ -1390,6 +1416,16 @@ GdtfWheelSlotAnimationSystem* GdtfWheelSlot::GetAnimationSystem() const return fAnimationSystem; } +double GdtfWheelSlot::GetDuration() const { return fDuration; } +size_t GdtfWheelSlot::GetWidth() const { return fWidth; } +size_t GdtfWheelSlot::GetHeight() const { return fHeight; } +size_t GdtfWheelSlot::GetFPS() const { return fFPS; } + +void GdtfWheelSlot::SetDuration(double duration) { fDuration = duration; } +void GdtfWheelSlot::SetWidth(size_t width) { fWidth = width; } +void GdtfWheelSlot::SetHeight(size_t height) { fHeight = height; } +void GdtfWheelSlot::SetFPS(size_t fps) { fFPS = fps; } + //------------------------------------------------------------------------------------ // GdtfModel GdtfModel::GdtfModel(GdtfFixture* fixture) @@ -2911,7 +2947,7 @@ GdtfGeometryDisplay::GdtfGeometryDisplay(GdtfGeometry* parent) GdtfGeometryDisplay::GdtfGeometryDisplay(const TXString& name, GdtfModelPtr refToModel,const VWTransformMatrix& ma, GdtfGeometry* parent) :GdtfGeometry(name,refToModel,ma, parent) { - fTexture = ""; + fTexture = ""; } GdtfGeometryDisplay::~GdtfGeometryDisplay() @@ -2928,12 +2964,45 @@ void GdtfGeometryDisplay::SetTexture(const TXString& texture) fTexture = texture; } +const size_t& GdtfGeometryDisplay::GetWidth() const +{ + return fWidth; +} + +void GdtfGeometryDisplay::SetWidth( size_t width ) +{ + fWidth = width; +} + +const size_t& GdtfGeometryDisplay::GetHeight() const +{ + return fHeight; +} + +void GdtfGeometryDisplay::SetHeight( size_t height ) +{ + fHeight = height; +} + +void GdtfGeometryDisplay::SetIsCurved( const bool& isCurved ) +{ + fIsCurved = isCurved; +} + +void GdtfGeometryDisplay::GetIsCurved( bool& curvedRadius ) const +{ + curvedRadius = fIsCurved; +} + void GdtfGeometryDisplay::OnPrintToFile(IXMLFileNodePtr pNode) { //------------------------------------------------------------------------------------ // Call the parent GdtfGeometry::OnPrintToFile(pNode); - pNode->SetNodeAttributeValue(XML_GDTF_DisplayTexture, fTexture); + pNode->SetNodeAttributeValue( XML_GDTF_DisplayTexture, fTexture ); + pNode->SetNodeAttributeValue( XML_GDTF_DisplayWidth, GdtfConverter::ConvertInteger(fWidth) ); + pNode->SetNodeAttributeValue( XML_GDTF_DisplayHeight, GdtfConverter::ConvertInteger( fHeight ) ); + pNode->SetNodeAttributeValue( XML_GDTF_DisplayIsCurved, fIsCurved ? "true" : "false" ); } void GdtfGeometryDisplay::OnReadFromNode(const IXMLFileNodePtr& pNode) @@ -2942,7 +3011,16 @@ void GdtfGeometryDisplay::OnReadFromNode(const IXMLFileNodePtr& pNode) // Call the parent GdtfGeometry::OnReadFromNode(pNode); - pNode->GetNodeAttributeValue(XML_GDTF_DisplayTexture, fTexture); + TXString width, height, isCurved = ""; + + pNode->GetNodeAttributeValue( XML_GDTF_DisplayTexture, fTexture); + pNode->GetNodeAttributeValue( XML_GDTF_DisplayWidth, width ); + pNode->GetNodeAttributeValue( XML_GDTF_DisplayHeight, height ); + pNode->GetNodeAttributeValue( XML_GDTF_DisplayIsCurved, isCurved ); + + GdtfConverter::ConvertInteger( width, pNode, fWidth ); + GdtfConverter::ConvertInteger( height, pNode, fHeight ); + GdtfConverter::ConvertBool( isCurved, pNode, fIsCurved ); } void GdtfGeometryDisplay::OnErrorCheck(const IXMLFileNodePtr& pNode) diff --git a/src/GDTFManager.h b/src/GDTFManager.h index 9820bf6b..c060b09a 100644 --- a/src/GDTFManager.h +++ b/src/GDTFManager.h @@ -428,6 +428,10 @@ namespace SceneData GdtfFilter* fFilter; TXString fUnresolvedFilter; GdtfWheelSlotAnimationSystem* fAnimationSystem; + double fDuration; + size_t fWidth; + size_t fHeight; + size_t fFPS; public: const TXString& GetGobo() const; @@ -437,6 +441,10 @@ namespace SceneData TGdtfWheelSlotPrismFacetArray GetPrismFacets(); GdtfFilter* GetFilter() const; GdtfWheelSlotAnimationSystem* GetAnimationSystem() const; + double GetDuration() const; + size_t GetWidth() const; + size_t GetHeight() const; + size_t GetFPS() const; void SetName(const TXString& name); void SetGobo(const GdtfPNGFile& png); @@ -444,6 +452,10 @@ namespace SceneData void SetFilter(GdtfFilter* filter); GdtfWheelSlotPrismFacet* AddPrismFacet(); GdtfWheelSlotAnimationSystem* AddAnimationSystem(); + void SetDuration(double duration); + void SetWidth(size_t width); + void SetHeight(size_t height); + void SetFPS(size_t fps); virtual TXString GetNodeReference(); @@ -963,10 +975,23 @@ namespace SceneData ~GdtfGeometryDisplay(); private: TXString fTexture; + size_t fWidth; + size_t fHeight; + bool fIsCurved; + public: virtual EGdtfObjectType GetObjectType(); const TXString& GetTexture(); + void GetIsCurved( bool& curvedRadius ) const; + const size_t& GetHeight() const; + const size_t& GetWidth() const; + void SetTexture(const TXString& texture); + void SetWidth( size_t width ); + void SetHeight( size_t height ); + void SetIsCurved( const bool& isCurved ); + + protected: virtual TXString GetNodeName(); virtual void OnPrintToFile(IXMLFileNodePtr pNode); @@ -2643,10 +2668,10 @@ namespace SceneData public: virtual EGdtfObjectType GetObjectType(); - // Getter + // Getter double GetColorTemperature() const; TGdtf_CRIArray GetCRI_Array() const; - // Setter + // Setter void SetColorTemperature(double val); GdtfCRIPtr Add_CRI(EGdtfColorSample ces, Sint32 colorTemp); protected: diff --git a/src/Implementation/CGdtfCRIGroup.cpp b/src/Implementation/CGdtfCRIGroup.cpp index f9ebd428..87f9b502 100644 --- a/src/Implementation/CGdtfCRIGroup.cpp +++ b/src/Implementation/CGdtfCRIGroup.cpp @@ -4,6 +4,7 @@ #include "Prefix/StdAfx.h" #include "CGdtfCRIGroup.h" #include "CGdtfCRI.h" +#include "Utility.h" VectorworksMVR::CGdtfCRIGroupImpl::CGdtfCRIGroupImpl() { @@ -45,6 +46,9 @@ VectorworksMVR::VCOMError VectorworksMVR::CGdtfCRIGroupImpl::GetCRICount(size_t VectorworksMVR::VCOMError VectorworksMVR::CGdtfCRIGroupImpl::GetCRIAt(size_t at, VectorworksMVR::IGdtfCRI** value) { + if (!value) { return kVCOMError_InvalidArg; } + *value = nullptr; + // Check if Set if (!fCRIGroup) { return kVCOMError_NotInitialized; } @@ -74,6 +78,12 @@ VectorworksMVR::VCOMError VectorworksMVR::CGdtfCRIGroupImpl::GetCRIAt(size_t at, return kVCOMError_NoInterface; } } + else + { + return kVCOMError_NoInterface; + } + + if (!pCRIObj) { return kVCOMError_NoInterface; } //--------------------------------------------------------------------------- // Check Incomming Object @@ -93,6 +103,9 @@ VectorworksMVR::VCOMError VectorworksMVR::CGdtfCRIGroupImpl::GetCRIAt(size_t at, VectorworksMVR::VCOMError VectorworksMVR::CGdtfCRIGroupImpl::CreateCRI(EGdtfColorSample ces, Sint32 colorTemp, VectorworksMVR::IGdtfCRI **outVal) { + if (!outVal) { return kVCOMError_InvalidArg; } + *outVal = nullptr; + // Check if Set if (!fCRIGroup) { return kVCOMError_NotInitialized; } @@ -119,6 +132,12 @@ VectorworksMVR::VCOMError VectorworksMVR::CGdtfCRIGroupImpl::CreateCRI(EGdtfColo return kVCOMError_NoInterface; } } + else + { + return kVCOMError_NoInterface; + } + + if (!pCRIObj) { return kVCOMError_NoInterface; } //--------------------------------------------------------------------------- // Check Incomming Object diff --git a/src/Implementation/CGdtfCRIGroup.h b/src/Implementation/CGdtfCRIGroup.h index 89460b40..d4e8e171 100644 --- a/src/Implementation/CGdtfCRIGroup.h +++ b/src/Implementation/CGdtfCRIGroup.h @@ -12,7 +12,7 @@ namespace VectorworksMVR public: CGdtfCRIGroupImpl(); virtual ~CGdtfCRIGroupImpl(); - + virtual VCOMError VCOM_CALLTYPE GetColorTemperature(double& outVal); virtual VCOMError VCOM_CALLTYPE SetColorTemperature(double value); diff --git a/src/Implementation/CGdtfFixture.cpp b/src/Implementation/CGdtfFixture.cpp index e6a6e92b..30bb1cbc 100755 --- a/src/Implementation/CGdtfFixture.cpp +++ b/src/Implementation/CGdtfFixture.cpp @@ -2234,6 +2234,9 @@ VectorworksMVR::VCOMError VectorworksMVR::CGdtfFixtureImpl::GetCRIGroupCount(siz VectorworksMVR::VCOMError VectorworksMVR::CGdtfFixtureImpl::GetCRIGroupAt(size_t at, VectorworksMVR::IGdtfCRIGroup** value) { + if (!value) { return kVCOMError_InvalidArg; } + *value = nullptr; + // Check if Set if (!fFixtureObject) { return kVCOMError_NotInitialized; } @@ -2264,6 +2267,12 @@ VectorworksMVR::VCOMError VectorworksMVR::CGdtfFixtureImpl::GetCRIGroupAt(size_t return kVCOMError_NoInterface; } } + else + { + return kVCOMError_NoInterface; + } + + if (!pCRIGroupObj) { return kVCOMError_NoInterface; } //--------------------------------------------------------------------------- // Check Incomming Object @@ -2283,6 +2292,9 @@ VectorworksMVR::VCOMError VectorworksMVR::CGdtfFixtureImpl::GetCRIGroupAt(size_t VectorworksMVR::VCOMError VectorworksMVR::CGdtfFixtureImpl::CreateCRIGroup(double colorTemp, VectorworksMVR::IGdtfCRIGroup **outVal) { + if (!outVal) { return kVCOMError_InvalidArg; } + *outVal = nullptr; + // Check if Set if (!fFixtureObject) { return kVCOMError_NotInitialized; } @@ -2309,6 +2321,12 @@ VectorworksMVR::VCOMError VectorworksMVR::CGdtfFixtureImpl::CreateCRIGroup(doubl return kVCOMError_NoInterface; } } + else + { + return kVCOMError_NoInterface; + } + + if (!pCRIGroupObj) { return kVCOMError_NoInterface; } //--------------------------------------------------------------------------- // Check Incomming Object diff --git a/src/Implementation/CGdtfGeometry.cpp b/src/Implementation/CGdtfGeometry.cpp index abb6012f..75bac241 100644 --- a/src/Implementation/CGdtfGeometry.cpp +++ b/src/Implementation/CGdtfGeometry.cpp @@ -983,6 +983,90 @@ VectorworksMVR::VCOMError VectorworksMVR::CGdtfGeometryImpl::SetTexture(MvrStrin return kVCOMError_NoError; } +VectorworksMVR::VCOMError VectorworksMVR::CGdtfGeometryImpl::GetWidth(size_t& width) +{ + if(!fGeometry) return kVCOMError_Failed; + + if( fGeometryType != EGdtfObjectType::eGdtfGeometryDisplay) return kVCOMError_Failed; + + SceneData::GdtfGeometryDisplayPtr display = static_cast(fGeometry); + if(!display) return kVCOMError_Failed; + + width = display->GetWidth(); + + return kVCOMError_NoError; +} + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfGeometryImpl::SetWidth(size_t width) +{ + if (!fGeometry) return kVCOMError_NotInitialized; + + if( fGeometryType != EGdtfObjectType::eGdtfGeometryDisplay) return kVCOMError_WrongGeometryType; + + SceneData::GdtfGeometryDisplayPtr display = static_cast(fGeometry); + if(!display) return kVCOMError_Failed; + + display->SetWidth(width); + + return kVCOMError_NoError; +} + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfGeometryImpl::GetHeight(size_t& height) +{ + if(!fGeometry) return kVCOMError_Failed; + + if( fGeometryType != EGdtfObjectType::eGdtfGeometryDisplay) return kVCOMError_Failed; + + SceneData::GdtfGeometryDisplayPtr display = static_cast(fGeometry); + if(!display) return kVCOMError_Failed; + + height = display->GetHeight(); + + return kVCOMError_NoError; +} + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfGeometryImpl::SetHeight(size_t height) +{ + if (!fGeometry) return kVCOMError_NotInitialized; + + if( fGeometryType != EGdtfObjectType::eGdtfGeometryDisplay) return kVCOMError_WrongGeometryType; + + SceneData::GdtfGeometryDisplayPtr display = static_cast(fGeometry); + if(!display) return kVCOMError_Failed; + + display->SetHeight(height); + + return kVCOMError_NoError; +} + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfGeometryImpl::GetIsCurved(bool& isCurved) +{ + if(!fGeometry) return kVCOMError_Failed; + + if( fGeometryType != EGdtfObjectType::eGdtfGeometryDisplay) return kVCOMError_Failed; + + SceneData::GdtfGeometryDisplayPtr display = static_cast(fGeometry); + if(!display) return kVCOMError_Failed; + + display->GetIsCurved(isCurved); + + return kVCOMError_NoError; +} + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfGeometryImpl::SetIsCurved(bool isCurved) +{ + if (!fGeometry) return kVCOMError_NotInitialized; + + if( fGeometryType != EGdtfObjectType::eGdtfGeometryDisplay) return kVCOMError_WrongGeometryType; + + SceneData::GdtfGeometryDisplayPtr display = static_cast(fGeometry); + if(!display) return kVCOMError_Failed; + + display->SetIsCurved(isCurved); + + return kVCOMError_NoError; +} + VectorworksMVR::VCOMError VectorworksMVR::CGdtfGeometryImpl::GetCountLinkedDmxChannel(size_t& count, IGdtfDmxMode * forMode) { // Get Count diff --git a/src/Implementation/CGdtfGeometry.h b/src/Implementation/CGdtfGeometry.h index 24c168ed..08c754e0 100644 --- a/src/Implementation/CGdtfGeometry.h +++ b/src/Implementation/CGdtfGeometry.h @@ -65,7 +65,14 @@ namespace VectorworksMVR // Display virtual MvrString VCOM_CALLTYPE GetTexture(); - virtual VCOMError VCOM_CALLTYPE SetTexture(MvrString texture); + virtual VCOMError VCOM_CALLTYPE GetWidth( size_t& width ); + virtual VCOMError VCOM_CALLTYPE GetHeight( size_t& height ); + virtual VCOMError VCOM_CALLTYPE GetIsCurved( bool& isCurved ); + + virtual VCOMError VCOM_CALLTYPE SetTexture(MvrString texture); + virtual VCOMError VCOM_CALLTYPE SetWidth( size_t width ); + virtual VCOMError VCOM_CALLTYPE SetHeight( size_t height ); + virtual VCOMError VCOM_CALLTYPE SetIsCurved( bool isCurved ); // Helpers virtual VCOMError VCOM_CALLTYPE GetCountLinkedDmxChannel(size_t& count, IGdtfDmxMode * forMode); diff --git a/src/Implementation/CGdtfWheelSlot.cpp b/src/Implementation/CGdtfWheelSlot.cpp index 7b9922d2..2889b9a4 100644 --- a/src/Implementation/CGdtfWheelSlot.cpp +++ b/src/Implementation/CGdtfWheelSlot.cpp @@ -374,3 +374,59 @@ VectorworksMVR::VCOMError VectorworksMVR::CGdtfWheelSlotImpl::SetFilter (IGdtfFi return kVCOMError_NoError; } + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfWheelSlotImpl::GetDuration(double& outDuration) +{ + if(!fWheelSlot) return kVCOMError_NotInitialized; + outDuration = fWheelSlot->GetDuration(); + return kVCOMError_NoError; +} + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfWheelSlotImpl::GetWidth(size_t& outWidth) +{ + if(!fWheelSlot) return kVCOMError_NotInitialized; + outWidth = fWheelSlot->GetWidth(); + return kVCOMError_NoError; +} + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfWheelSlotImpl::GetHeight(size_t& outHeight) +{ + if(!fWheelSlot) return kVCOMError_NotInitialized; + outHeight = fWheelSlot->GetHeight(); + return kVCOMError_NoError; +} + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfWheelSlotImpl::GetFPS(size_t& outFPS) +{ + if(!fWheelSlot) return kVCOMError_NotInitialized; + outFPS = fWheelSlot->GetFPS(); + return kVCOMError_NoError; +} + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfWheelSlotImpl::SetDuration(double duration) +{ + if(!fWheelSlot) return kVCOMError_NotInitialized; + fWheelSlot->SetDuration(duration); + return kVCOMError_NoError; +} + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfWheelSlotImpl::SetWidth(size_t width) +{ + if(!fWheelSlot) return kVCOMError_NotInitialized; + fWheelSlot->SetWidth(width); + return kVCOMError_NoError; +} + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfWheelSlotImpl::SetHeight(size_t height) +{ + if(!fWheelSlot) return kVCOMError_NotInitialized; + fWheelSlot->SetHeight(height); + return kVCOMError_NoError; +} + +VectorworksMVR::VCOMError VectorworksMVR::CGdtfWheelSlotImpl::SetFPS(size_t fps) +{ + if(!fWheelSlot) return kVCOMError_NotInitialized; + fWheelSlot->SetFPS(fps); + return kVCOMError_NoError; +} diff --git a/src/Implementation/CGdtfWheelSlot.h b/src/Implementation/CGdtfWheelSlot.h index 5eeb497a..c2d541a8 100644 --- a/src/Implementation/CGdtfWheelSlot.h +++ b/src/Implementation/CGdtfWheelSlot.h @@ -32,6 +32,15 @@ namespace VectorworksMVR virtual VCOMError VCOM_CALLTYPE GetAnimationSystem(IGdtfWheelSlotAnimationSystem** outAnimationSystem); virtual VCOMError VCOM_CALLTYPE CreateAnimationSystem(double p1_X, double p1_Y, double p2_X, double p2_Y, double p3_X, double p3_Y, double radius, IGdtfWheelSlotAnimationSystem** outAnimationSystem); + + virtual VCOMError VCOM_CALLTYPE GetDuration(double& outDuration); + virtual VCOMError VCOM_CALLTYPE GetWidth(size_t& outWidth); + virtual VCOMError VCOM_CALLTYPE GetHeight(size_t& outHeight); + virtual VCOMError VCOM_CALLTYPE GetFPS(size_t& outFPS); + virtual VCOMError VCOM_CALLTYPE SetDuration(double duration); + virtual VCOMError VCOM_CALLTYPE SetWidth(size_t width); + virtual VCOMError VCOM_CALLTYPE SetHeight(size_t height); + virtual VCOMError VCOM_CALLTYPE SetFPS(size_t fps); virtual VCOMError VCOM_CALLTYPE BindToObject(void* objAddr); virtual void* VCOM_CALLTYPE GetBoundObject(); diff --git a/src/Include/IMediaRessourceVectorInterface.h b/src/Include/IMediaRessourceVectorInterface.h index e080a8d8..9a172775 100644 --- a/src/Include/IMediaRessourceVectorInterface.h +++ b/src/Include/IMediaRessourceVectorInterface.h @@ -684,6 +684,16 @@ namespace VectorworksMVR //GDTF 1.1 virtual VCOMError VCOM_CALLTYPE GetAnimationSystem(IGdtfWheelSlotAnimationSystem** outAnimationSystem) = 0; virtual VCOMError VCOM_CALLTYPE CreateAnimationSystem(double p1_X, double p1_Y, double p2_X, double p2_Y, double p3_X, double p3_Y, double radius, IGdtfWheelSlotAnimationSystem** outAnimationSystem) = 0; + + // Spec PR #305 - Media content attributes + virtual VCOMError VCOM_CALLTYPE GetDuration(double& outDuration) = 0; + virtual VCOMError VCOM_CALLTYPE GetWidth(size_t& outWidth) = 0; + virtual VCOMError VCOM_CALLTYPE GetHeight(size_t& outHeight) = 0; + virtual VCOMError VCOM_CALLTYPE GetFPS(size_t& outFPS) = 0; + virtual VCOMError VCOM_CALLTYPE SetDuration(double duration) = 0; + virtual VCOMError VCOM_CALLTYPE SetWidth(size_t width) = 0; + virtual VCOMError VCOM_CALLTYPE SetHeight(size_t height) = 0; + virtual VCOMError VCOM_CALLTYPE SetFPS(size_t fps) = 0; }; typedef VCOMPtr IGdtfWheelSlotPtr; @@ -861,7 +871,14 @@ namespace VectorworksMVR // Display virtual MvrString VCOM_CALLTYPE GetTexture() = 0; + virtual VCOMError VCOM_CALLTYPE GetWidth( size_t& width ) = 0; + virtual VCOMError VCOM_CALLTYPE GetHeight( size_t& height ) = 0; + virtual VCOMError VCOM_CALLTYPE GetIsCurved( bool& isCurved ) = 0; + virtual VCOMError VCOM_CALLTYPE SetTexture(MvrString texture) = 0; + virtual VCOMError VCOM_CALLTYPE SetWidth( size_t width ) = 0; + virtual VCOMError VCOM_CALLTYPE SetHeight( size_t height ) = 0; + virtual VCOMError VCOM_CALLTYPE SetIsCurved( bool isCurved ) = 0; // GDTF 1.2 // Lamp diff --git a/src/ModuleMain.cpp b/src/ModuleMain.cpp index 2a3592db..7d49e276 100644 --- a/src/ModuleMain.cpp +++ b/src/ModuleMain.cpp @@ -60,6 +60,8 @@ #include "Implementation/CGdtfPoint.h" #include "Implementation/CGdtfColorSpace.h" #include "Implementation/CGdtfConnector.h" +#include "Implementation/CGdtfCRIGroup.h" +#include "Implementation/CGdtfCRI.h" #include "Implementation/CUtility.h" #include "Implementation/CGdtfLaserProtocol.h" #include "Implementation/CGdtfPinPatch.h" @@ -209,6 +211,10 @@ extern "C" VectorworksMVR::VCOMError VWQueryInterface(const VectorworksMVR::VWII resultInterface = new CGdtfColorSpaceImpl(); else if (iid == VectorworksMVR::IID_GdtfGamut) resultInterface = new CGdtfGamutImpl(); + else if (iid == VectorworksMVR::IID_GdtfCRIGroup) + resultInterface = new CGdtfCRIGroupImpl(); + else if (iid == VectorworksMVR::IID_GdtfCRI) + resultInterface = new CGdtfCRIImpl(); else if (iid == VectorworksMVR::IID_GdtfConnector) resultInterface = new CGdtfConnectorImpl(); else if (iid == VectorworksMVR::Filing::IID_FileIdentifier) diff --git a/src/Prefix/CommonPrefix.h b/src/Prefix/CommonPrefix.h index b3585592..3999bbbf 100644 --- a/src/Prefix/CommonPrefix.h +++ b/src/Prefix/CommonPrefix.h @@ -390,6 +390,10 @@ const Sint32 kGDTF_CurrentMinorVersion = 2; #define XML_GDTF_WheelSlotColor "Color" #define XML_GDTF_WheelSlotPicture "MediaFileName" #define XML_GDTF_WheelSlotFilter "Filter" +#define XML_GDTF_WheelSlotDuration "Duration" +#define XML_GDTF_WheelSlotWidth "Width" +#define XML_GDTF_WheelSlotHeight "Height" +#define XML_GDTF_WheelSlotFPS "FPS" #define XML_GDTF_PrismFacetNodeName "Facet" #define XML_GDTF_PrismFacetColor "Color" @@ -452,6 +456,9 @@ const Sint32 kGDTF_CurrentMinorVersion = 2; #define XML_GDTF_DisplayNodeName "Display" #define XML_GDTF_DisplayTexture "Texture" +#define XML_GDTF_DisplayWidth "Width" +#define XML_GDTF_DisplayHeight "Height" +#define XML_GDTF_DisplayIsCurved "IsCurved" #define XML_GDTF_LaserProtocolNodeName "Protocol" #define XML_GDTF_LaserProtocolName "Name" diff --git a/src/XmlFileHelper.cpp b/src/XmlFileHelper.cpp index d46eeec5..8faca3a8 100644 --- a/src/XmlFileHelper.cpp +++ b/src/XmlFileHelper.cpp @@ -1697,10 +1697,12 @@ CieColor SceneData::GdtfConverter::ConvertCColor(const CCieColor & color) else if (inVal == XML_GDTF_ColorSample_97) { outVal = EGdtfColorSample::CES_97; } else if (inVal == XML_GDTF_ColorSample_98) { outVal = EGdtfColorSample::CES_98; } else if (inVal == XML_GDTF_ColorSample_99) { outVal = EGdtfColorSample::CES_99; } - - DSTOP((kEveryone, "Unknown Value for EGdtfColorSample")); - GdtfParsingError error (GdtfDefines::EGdtfParsingError::eValueError_NoMatchInEnum_ConvertColorSample, node); - SceneData::GdtfFixture::AddError(error); + else + { + DSTOP((kEveryone, "Unknown Value for EGdtfColorSample")); + GdtfParsingError error (GdtfDefines::EGdtfParsingError::eValueError_NoMatchInEnum_ConvertColorSample, node); + SceneData::GdtfFixture::AddError(error); + } return true; } diff --git a/unittest/EmptyGeometryUnitTest.cpp b/unittest/EmptyGeometryUnitTest.cpp index a7bcd09f..7f0a72a9 100644 --- a/unittest/EmptyGeometryUnitTest.cpp +++ b/unittest/EmptyGeometryUnitTest.cpp @@ -13,7 +13,7 @@ using namespace VectorworksMVR::GdtfDefines; #define __checkVCOM(x) this->checkVCOM(x, #x) #define __checkVCOM_NotSet(x) this->checkVCOM_NotSet(x, #x) -GdtfEmptyModelTest::GdtfEmptyModelTest(const std::string& currentDir) : GdtfUnitTest(currentDir) +GdtfEmptyModelTest::GdtfEmptyModelTest(const std::string& currentDir) { } @@ -21,10 +21,20 @@ GdtfEmptyModelTest::~GdtfEmptyModelTest() { } +bool GdtfEmptyModelTest::ExecuteTest() +{ + std::cout << "= GdtfEmptyModelTest =" << std::endl; -std::string GdtfEmptyModelTest::GetUnitTestName() -{ - return std::string("GdtfEmptyModel"); + VectorworksMVR::IGdtfFixturePtr fixture( IID_IGdtfFixture ); + fixture->OpenForWrite( "EmptyGeometryUnitTest", "MVR Group", MvrUUID(1,1,1,1) ); + + WriteFile(fixture); + + fixture->Close(); + + ReadFile(fixture); + + return true; } void GdtfEmptyModelTest::WriteFile(VectorworksMVR::IGdtfFixturePtr& fixture) @@ -54,6 +64,10 @@ void GdtfEmptyModelTest::WriteFile(VectorworksMVR::IGdtfFixturePtr& fixture) IGdtfGeometryPtr geometry4; __checkVCOM(geometry1->CreateGeometry(EGdtfObjectType::eGdtfGeometryDisplay, "Geometry4", filledModel, STransformMatrix(), &geometry4)); __checkVCOM(geometry4->SetTexture("Texture.png")); + __checkVCOM(geometry4->SetWidth(4700)); + __checkVCOM(geometry4->SetHeight(2700)); + __checkVCOM(geometry4->SetIsCurved(false)); + // Magnet IGdtfGeometryPtr geometry5; @@ -200,6 +214,18 @@ void GdtfEmptyModelTest::ReadFile(VectorworksMVR::IGdtfFixturePtr& fixture) checkifEqual("Check Texture", geometry4->GetTexture(), "Texture.png"); + size_t width = 0; + geometry4->GetWidth( width ); + checkifEqual( "Check Width", width, (size_t) 4700 ); + + size_t height = 0; + geometry4->GetHeight( height ); + checkifEqual( "Check Height", height, (size_t) 2700 ); + + bool isCurved = false; + geometry4->GetIsCurved( isCurved ); + checkifEqual( "Check IsCurved", isCurved, false ); + // Magnet IGdtfGeometryPtr geoMagnet; __checkVCOM(geometry1->GetInternalGeometryAt(3, &geoMagnet)); diff --git a/unittest/EmptyGeometryUnitTest.h b/unittest/EmptyGeometryUnitTest.h index f42025ea..a1c91007 100644 --- a/unittest/EmptyGeometryUnitTest.h +++ b/unittest/EmptyGeometryUnitTest.h @@ -7,16 +7,16 @@ #include "GdtfUnittestHandler.h" -class GdtfEmptyModelTest : public GdtfUnitTest +class GdtfEmptyModelTest : public Unittest { public: GdtfEmptyModelTest(const std::string& currentDir); virtual ~GdtfEmptyModelTest(); protected: - std::string virtual GetUnitTestName() override; + bool virtual ExecuteTest(); private: - void virtual WriteFile(VectorworksMVR::IGdtfFixturePtr& fixtureDuringRead) override; - void virtual ReadFile(VectorworksMVR::IGdtfFixturePtr& fixtureDuringWrite) override; + void WriteFile(VectorworksMVR::IGdtfFixturePtr& fixtureDuringRead); + void ReadFile(VectorworksMVR::IGdtfFixturePtr& fixtureDuringWrite); }; \ No newline at end of file diff --git a/unittest/GdtfUnittest.cpp b/unittest/GdtfUnittest.cpp index 5c665cd4..65b6f376 100644 --- a/unittest/GdtfUnittest.cpp +++ b/unittest/GdtfUnittest.cpp @@ -194,6 +194,11 @@ void GdtfUnittest::WriteFile() IGdtfWheelSlotAnimationSystemPtr gdtfAnimationSystem; __checkVCOM(wheelSlotContainer->CreateAnimationSystem(1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0 /*radius*/, &gdtfAnimationSystem)); + // Set media content attributes (Spec PR #305) + __checkVCOM(wheelSlotContainer->SetDuration(12.345)); + __checkVCOM(wheelSlotContainer->SetWidth(1920)); + __checkVCOM(wheelSlotContainer->SetHeight(1080)); + __checkVCOM(wheelSlotContainer->SetFPS(30)); // Set Filter link __checkVCOM(wheelSlotContainer->SetFilter(gdtfFilter)); @@ -671,6 +676,18 @@ void GdtfUnittest::ReadFile() } + // Media content attributes (Spec PR #305) + double duration = 0.0; + size_t width = 0, height = 0, fps = 0; + __checkVCOM(gdtfSlot->GetDuration(duration)); + __checkVCOM(gdtfSlot->GetWidth(width)); + __checkVCOM(gdtfSlot->GetHeight(height)); + __checkVCOM(gdtfSlot->GetFPS(fps)); + this->checkifEqual("GetWheelSlotDuration ", duration, 12.345); + this->checkifEqual("GetWheelSlotWidth ", width, size_t(1920)); + this->checkifEqual("GetWheelSlotHeight ", height, size_t(1080)); + this->checkifEqual("GetWheelSlotFPS ", fps, size_t(30)); + } // WheelSlot loop } } // Wheels loop diff --git a/unittest/Unittest.cpp b/unittest/Unittest.cpp index 2de1fc85..8a3055f6 100644 --- a/unittest/Unittest.cpp +++ b/unittest/Unittest.cpp @@ -265,6 +265,7 @@ void Unittest::checkifEqual(const std::string& check, const std::string& aspecte fFailedTests.push_back(test); + std::cout << "Failed Test: " << test.fMessage << std::endl; }; bool Unittest::checkVCOM(VectorworksMVR::VCOMError error, const std::string& check) diff --git a/unittest/Utility.cpp b/unittest/Utility.cpp index b0e302b8..4314d93f 100644 --- a/unittest/Utility.cpp +++ b/unittest/Utility.cpp @@ -53,6 +53,7 @@ bool UnitTestUtil::GetFolderAppDataLocal(std::string& outPath) if(!result) return false; std::wstring ws(buffer); outPath = std::string(ws.begin(), ws.end()); + std::cout << "AppData Local Folder: " << outPath << std::endl; #elif _LINUX // LINUX_IMPLEMENTATION - done