From: guigues Date: Tue, 24 Feb 2009 14:47:07 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: EED.02Oct2009~171 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=3e7eac431db6401f86374784eaa66ad276af1bac;p=creaImageIO.git *** empty log message *** --- diff --git a/appli/CMakeLists.txt b/appli/CMakeLists.txt index 2c2bcd1..79f376b 100644 --- a/appli/CMakeLists.txt +++ b/appli/CMakeLists.txt @@ -2,6 +2,7 @@ IF (BUILD_V2) SUBDIRS(gimmick) SUBDIRS(wxGimmick) SUBDIRS(TestWxGimmickReaderDialog) + SUBDIRS(TestGimmickReaderDialog) ELSE (BUILD_V2) SUBDIRS(TestWxGimmickDialog) ENDIF (BUILD_V2) diff --git a/appli/TestGimmickReaderDialog/CMakeLists.txt b/appli/TestGimmickReaderDialog/CMakeLists.txt new file mode 100644 index 0000000..ec9dbb0 --- /dev/null +++ b/appli/TestGimmickReaderDialog/CMakeLists.txt @@ -0,0 +1,11 @@ + +IF(WIN32) + ADD_EXECUTABLE(TestGimmickReaderDialog WIN32 main) + SET_TARGET_PROPERTIES(TestGimmickReaderDialog PROPERTIES LINK_FLAGS /subsystem:console ) +ELSE(WIN32) + ADD_EXECUTABLE(TestGimmickReaderDialog main) +ENDIF(WIN32) + +TARGET_LINK_LIBRARIES( TestGimmickReaderDialog creaImageIO2) + +INSTALL_TARGETS(/bin/ TestGimmickReaderDialog ) diff --git a/appli/TestGimmickReaderDialog/main.cxx b/appli/TestGimmickReaderDialog/main.cxx new file mode 100644 index 0000000..fc35ca8 --- /dev/null +++ b/appli/TestGimmickReaderDialog/main.cxx @@ -0,0 +1,24 @@ +#include + +#include + +#include + +int main(int argc, char* argv[]) +{ + std::vector images; + bool r = creaImageIO::GimmickReaderDialog(images, + "GimmickReaderDialog test", + 0,0,800,800,2,3,3,1); + + if (r) + { + std::cout << "$$$$ main : user clicked 'OK' $$$$"<Delete(); + } + else + { + std::cout << "$$$$ main : user clicked 'CANCEL' $$$$"< +#include + + +class DummyWxApp : public wxApp +{ +public: + bool OnInit( ); + int OnExit() { return true; } +}; + +IMPLEMENT_APP_NO_MAIN(DummyWxApp); + + +bool DummyWxApp::OnInit( ) +{ +// std::cout << "OnInit()"<1) { // Add Attribute 'PARENT_ID' to Description - GetTree().GetLevelDescriptor(l).Add + GetTree().GetDescriptor().Add (AttributeDescriptor( "PARENT_ID", "Database Parent Identifier", 0,0, AttributeDescriptor::PRIVATE - )); + ),l); } } @@ -434,7 +434,7 @@ namespace creaImageIO tree::Descriptor& desc = GetTree().GetDescriptor(); // clears the existing one - desc.GetLevelDescriptorList().clear(); + desc.Clear(); int nblevel = 0; std::string query = "SELECT * FROM LEVELS"; @@ -445,7 +445,7 @@ namespace creaImageIO { std::string name = q.getStringField(0); GimmickMessage(2," * Importing level '"<& map ) const diff --git a/src2/creaImageIOTreeDescriptor.h b/src2/creaImageIOTreeDescriptor.h index 765b73f..26bbc5e 100644 --- a/src2/creaImageIOTreeDescriptor.h +++ b/src2/creaImageIOTreeDescriptor.h @@ -38,29 +38,30 @@ namespace creaImageIO /// Returns the LevelDescriptor of a given level (const ref) const LevelDescriptor& GetLevelDescriptor(int level) const { return mLevelDescriptorList[level]; } - /// Returns the LevelDescriptor of a given level (ref) - LevelDescriptor& GetLevelDescriptor(int level) - { return mLevelDescriptorList[level]; } /// Returns the AttributeDescriptorList of a given level (const ref) const LevelDescriptor::AttributeDescriptorListType& GetAttributeDescriptorList(int level) const { return mLevelDescriptorList[level].GetAttributeDescriptorList(); } - /// Returns the AttributeDescriptorList of a given level (ref) - //LevelDescriptor::AttributeDescriptorListType& - //GetAttributeDescriptorList(int level) - //{ return mLevelDescriptorList[level].GetAttributeDescriptorList(); } - + /// Adds a LevelDescriptor at the end of the list + void Add(const LevelDescriptor&); + + /// Adds an AttributeDescriptor to level l + void Add(const AttributeDescriptor&, int l); + + /// Builds the key to value map of all the attributes of the tree - void BuildAttributeMap( AttributeMapType& ) const; + void BuildAttributeMap( AttributeMapType& ) const; /// The type of LevelDescriptor container - typedef std::vector LevelDescriptorListType; - /// Returns the list of LevelDescriptor - LevelDescriptorListType& GetLevelDescriptorList() { return mLevelDescriptorList; } + typedef std::vector LevelDescriptorListType; + /// Returns the list of tree levels (const) - const LevelDescriptorListType& GetLevelDescriptorList() const { return mLevelDescriptorList; } + const LevelDescriptorListType& GetLevelDescriptorList() const { return mLevelDescriptorList; } + + /// Clears the Descriptor + void Clear(); private: LevelDescriptorListType mLevelDescriptorList; diff --git a/src2/creaImageIOTreeLevelDescriptor.cpp b/src2/creaImageIOTreeLevelDescriptor.cpp index bd0feca..ebb3c2c 100644 --- a/src2/creaImageIOTreeLevelDescriptor.cpp +++ b/src2/creaImageIOTreeLevelDescriptor.cpp @@ -5,24 +5,24 @@ namespace creaImageIO { namespace tree { - /// Adds the AttributeDescriptor to the list - void LevelDescriptor::Add(AttributeDescriptor a) - { - GimmickMessage(5,"Adding Attribute Descriptor '"< AttributeDescriptorListType; - /// Returns the list of AttributeDescriptor - //AttributeDescriptorListType& GetAttributeDescriptorList() - //{ return mAttributeDescriptorList; } + /// Returns the list of AttributeDescriptor (const) const AttributeDescriptorListType& GetAttributeDescriptorList() const { return mAttributeDescriptorList; } - /// \return The list of attributes with flag IDENTIFIER set - const std::vector& GetIdentifierList() const + /// \return The list of attributes with flag IDENTIFIER set + const std::vector& GetIdentifierList() const { return mIdentifierList; } /// \return The list of attributes with flag LABEL set const std::vector& GetLabelList() const