Skip to content
Closed
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
2 changes: 2 additions & 0 deletions src/GDTFManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7768,6 +7768,8 @@ bool GdtfFixture::ImportFromZip(IZIPFilePtr& zipfile)
IXMLFileNodePtr rootNode;
if (VCOM_SUCCEEDED(xmlFile->GetRootNode( & rootNode)))
{
rootNode->GetNodeAttributeValue(XML_GDTF_ROOTNODEATTRVERSION, gdtfFileVersion);

IXMLFileNodePtr fixtureNode;
if (VCOM_SUCCEEDED(rootNode->GetChildNode(XML_GDTF_FixtureNodeName, & fixtureNode)))
{
Expand Down
8 changes: 8 additions & 0 deletions src/GDTFManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -2754,6 +2754,11 @@ namespace SceneData

private:
//------------------------------------------------
// Parameters for the GdtfDataFile
TXString gdtfFileVersion = XML_GDTF_CurrentVersion;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it looks like all member variable had a prefix "f" in the name. So please adapt you changes.

TXString gdtfLatestVersion = XML_GDTF_CurrentVersion;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean with gdtfLatestVersion? GDTF file have only one version.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, a GDTF file could be an old one that was made using GDTF version 1.1, so GetGDTFFile would return 1.1
I would also like a function to return the latest GDTF Version that is available in GDTF-Share, i.e. 1.2.


//------------------------------------------------
// Parameters for a GdtfFixture
TXString fName;
TXString fShortName;
Expand Down Expand Up @@ -2820,6 +2825,9 @@ namespace SceneData
public:
//----------------------------------------------------------------------------------------------------------------------------------------------------------------
// Getter
const TXString& GetGdtfFileVersion() const { return gdtfFileVersion; }
const TXString& GetCurrentGdtfVersion() const { return gdtfLatestVersion; }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same question here: Why you need 2 APIs GetGdtfFileVersion and GetCurrentGdtfVersion? GDTF file can have only one version.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above comment.


const TXString& GetName() const;
const TXString& GetShortName() const;
const TXString& GetLongName() const;
Expand Down
14 changes: 14 additions & 0 deletions src/Implementation/CGdtfFixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,20 @@ VectorworksMVR::VCOMError VectorworksMVR::CGdtfFixtureImpl::ReadFromFile(IFileId
return retVal;
}

MvrString VectorworksMVR::CGdtfFixtureImpl::GetGdtfFileVersion()
{
if(!fFixtureObject) {return "";}

return fFixtureObject->GetGdtfFileVersion().GetCharPtr();
}

MvrString VectorworksMVR::CGdtfFixtureImpl::GetCurrentGdtfVersion()
{
if(!fFixtureObject) {return "";}

return fFixtureObject->GetCurrentGdtfVersion().GetCharPtr();
}

MvrString VectorworksMVR::CGdtfFixtureImpl::GetName()
{
if(!fFixtureObject) {return "";}
Expand Down
3 changes: 3 additions & 0 deletions src/Implementation/CGdtfFixture.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ namespace VectorworksMVR
virtual VCOMError VCOM_CALLTYPE AddBufferToGdtfFile(MvrString filename, const char* inBuffer, size_t length, GdtfDefines::ERessourceType resType);
virtual VCOMError VCOM_CALLTYPE Close();

virtual MvrString VCOM_CALLTYPE GetGdtfFileVersion();
virtual MvrString VCOM_CALLTYPE GetCurrentGdtfVersion();

virtual MvrString VCOM_CALLTYPE GetName();
virtual MvrString VCOM_CALLTYPE GetShortName();
virtual MvrString VCOM_CALLTYPE GetLongName();
Expand Down
3 changes: 3 additions & 0 deletions src/Include/IMediaRessourceVectorInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,9 @@ class DYNAMIC_ATTRIBUTE IGdtfMacro : public IVWUnknown

virtual VCOMError VCOM_CALLTYPE Close() = 0;

virtual MvrString VCOM_CALLTYPE GetGdtfFileVersion() = 0;
virtual MvrString VCOM_CALLTYPE GetCurrentGdtfVersion() = 0;

virtual MvrString VCOM_CALLTYPE GetName() = 0;
virtual MvrString VCOM_CALLTYPE GetManufacturer() = 0;
virtual VCOMError VCOM_CALLTYPE GetFixtureGUID(MvrUUID& uuid) = 0;
Expand Down