]> Creatis software - bbtkGEditor.git/blobdiff - lib/EditorGraphicBBS/bbsWxGUIEditorGraphic/wxVtkSceneManager.cxx
#3259 Export Format Python and JavaScript
[bbtkGEditor.git] / lib / EditorGraphicBBS / bbsWxGUIEditorGraphic / wxVtkSceneManager.cxx
index efb1439428e855a87277153dd4c4bef69c5aedbd..9aac1c3b0350d6da01270f3a96ed44618cf6a9a6 100644 (file)
@@ -77,6 +77,7 @@ wxVtkSceneManager::wxVtkSceneManager(wxGEditorTabPanel *parent, wxVtk3DBaseView
        _cbName                                 = "ComplexBoxName";
        _cbPackageName                  = "PackageName";
        _Author                                 = "Author ??";
+    _ExportFormat           = 0;
        _Category                               = "<VOID>";
        _Description                    = "Description ??";
        _MessageKind                    = "-";
@@ -1869,6 +1870,11 @@ void wxVtkSceneManager::saveDiagram(std::string &content)
        content += GetAuthor();
        content += "\n";
 
+    content += "EXPORTFORMAT:";
+    sprintf(buffer, "%d", GetExportFormat()) ;
+    content += buffer;
+    content += "\n";
+    
        //Print info IF COMPLEX BOX
        content += "COMPLEXBOX:";
        if (_isComplexBox) {
@@ -2022,6 +2028,9 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream)
                        }
             if (line == "# - BBTKGEditor v 1.5 BBG BlackBox Diagram file") {
                 version = line.substr(18, 3);
+            }
+            if (line == "# - BBTKGEditor v 1.6 BBG BlackBox Diagram file") {
+                version = line.substr(18, 3);
             }
                } else if (line == "APP_START") {
                        start = true;
@@ -2054,6 +2063,20 @@ void wxVtkSceneManager::loadDiagram(stringstream &inputStream)
                        result = strtok(authorTmp, delims);
                        result = strtok(NULL, delims);
                        SetAuthor(result);
+            
+            if(version >= "1.6")
+            {
+                getCleanLine(inputStream, line);//EXPORTFORMAT:<0:bbs 1:ALL 2:bbs,Python 3:bbs,JavaScript>
+                char authorTmp[255];
+                strcpy(authorTmp, line.c_str());
+                result = strtok(authorTmp, delims);
+                result = strtok(NULL, delims);
+                int exportformatTMP;
+                std::istringstream inps(result);
+                inps >> exportformatTMP;
+                SetExportFormat( exportformatTMP );
+            }
+            
                }
 
                //----------
@@ -3005,33 +3028,52 @@ void wxVtkSceneManager::SetCbPackageName(std::string packagename) {
 }
 
 //=========================================================================
-std::string wxVtkSceneManager::GetCbPackageName() {
+std::string wxVtkSceneManager::GetCbPackageName() 
+{
        return _cbPackageName;
 }
 
 //=========================================================================
-void wxVtkSceneManager::SetAuthor(std::string author) {
-       _Author = author;
-       if (_Author == "") {
-               _Author = "<author of the box>";
-       }
+void wxVtkSceneManager::SetAuthor(std::string author) 
+{
+    _Author = author;
+    if (_Author == "") 
+    {
+        _Author = "<author of the box>";
+    }
 }
 
 //=========================================================================
-std::string wxVtkSceneManager::GetAuthor() {
-       return _Author;
+std::string wxVtkSceneManager::GetAuthor() 
+{
+    return _Author;
+}
+
+//=========================================================================
+void wxVtkSceneManager::SetExportFormat(int exportformat) 
+{
+    _ExportFormat = exportformat;
+}
+
+//=========================================================================
+int wxVtkSceneManager::GetExportFormat()
+{
+    return _ExportFormat;
 }
 
 //=========================================================================
-void wxVtkSceneManager::SetCategory(std::string category) {
+void wxVtkSceneManager::SetCategory(std::string category) 
+{
        _Category = category;
-       if (_Category == "") {
+       if (_Category == "") 
+    {
                _Category = "<category of the box>";
        }
 }
 
 //=========================================================================
-std::string wxVtkSceneManager::GetCategory() {
+std::string wxVtkSceneManager::GetCategory() 
+{
        return _Category;
 }