Skip to content
Merged

Beta #171

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 81 additions & 3 deletions src/GDTFManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
}


Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);


//------------------------------------------------------------------------------------
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand All @@ -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)
Expand All @@ -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)
Expand Down
29 changes: 27 additions & 2 deletions src/GDTFManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -437,13 +441,21 @@ 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);
void SetColor(const CCieColor& color);
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();

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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:
Expand Down
19 changes: 19 additions & 0 deletions src/Implementation/CGdtfCRIGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "Prefix/StdAfx.h"
#include "CGdtfCRIGroup.h"
#include "CGdtfCRI.h"
#include "Utility.h"

VectorworksMVR::CGdtfCRIGroupImpl::CGdtfCRIGroupImpl()
{
Expand Down Expand Up @@ -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; }

Expand Down Expand Up @@ -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
Expand All @@ -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; }

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Implementation/CGdtfCRIGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace VectorworksMVR
public:
CGdtfCRIGroupImpl();
virtual ~CGdtfCRIGroupImpl();

virtual VCOMError VCOM_CALLTYPE GetColorTemperature(double& outVal);
virtual VCOMError VCOM_CALLTYPE SetColorTemperature(double value);

Expand Down
18 changes: 18 additions & 0 deletions src/Implementation/CGdtfFixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down Expand Up @@ -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
Expand All @@ -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; }

Expand All @@ -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
Expand Down
Loading
Loading