0026637: Save function works incorrect in OCAF mfc sample
authorski <ski@opencascade.com>
Tue, 8 Sep 2015 09:49:19 +0000 (12:49 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 10 Sep 2015 14:29:20 +0000 (17:29 +0300)
Format ".std" was eliminated from OCAF mfc sample.

samples/mfc/standard/06_Ocaf/res/Plugin
samples/mfc/standard/06_Ocaf/res/Resources
samples/mfc/standard/06_Ocaf/src/OcafApp.cpp
samples/mfc/standard/06_Ocaf/src/OcafDoc.cpp
samples/mfc/standard/06_Ocaf/src/TOcaf_Application.cxx

index 57e34c6..516a2ad 100755 (executable)
@@ -3,18 +3,6 @@
 !
 a148e300-5740-11d1-a904-080036aaa103.Location: FWOSPlugin
 !
-! standard attribute drivers plugin
-!
-ad696000-5b34-11d1-b5ba-00a0c9064368.Location: TKStdSchema
-ad696001-5b34-11d1-b5ba-00a0c9064368.Location: TKStdSchema
-ad696002-5b34-11d1-b5ba-00a0c9064368.Location: TKStdSchema
-!
-! standard attribute drivers plugin
-!
-bd696000-5b34-11d1-b5ba-00a0c9064368.Location: TKStdLSchema
-bd696001-5b34-11d1-b5ba-00a0c9064368.Location: TKStdLSchema
-bd696002-5b34-11d1-b5ba-00a0c9064368.Location: TKStdLSchema
-!
 ! XmlOcaf Document Plugin
 !
 03a56820-8269-11d5-aab2-0050044b1af1.Location: TKXml
@@ -37,12 +25,6 @@ bd696002-5b34-11d1-b5ba-00a0c9064368.Location: TKStdLSchema
 13a56835-8269-11d5-aab2-0050044b1af1.Location: TKBinL
 13a56836-8269-11d5-aab2-0050044b1af1.Location: TKBinL
 !
-! XCAF  Document Plugin
-!
-ed8793f8-3142-11d4-b9b5-0060b0ee281b.Location: TKXCAFSchema
-ed8793f9-3142-11d4-b9b5-0060b0ee281b.Location: TKXCAFSchema
-ed8793fa-3142-11d4-b9b5-0060b0ee281b.Location: TKXCAFSchema
-!
 ! XmlXCAF Document Plugin
 !
 f78ff496-a779-11d5-aab4-0050044b1af1.Location: TKXmlXCAF
index 9274516..2034eeb 100755 (executable)
@@ -1,20 +1,4 @@
-formatlist:Ocaf-Sample|XmlOcaf|BinOcaf
-!
-! standard attributes
-!
-Ocaf-Sample.Description: OCAF sample Document Version 1.0
-Ocaf-Sample.FileExtension: sta
-Ocaf-Sample.StoragePlugin: ad696000-5b34-11d1-b5ba-00a0c9064368
-Ocaf-Sample.RetrievalPlugin: ad696001-5b34-11d1-b5ba-00a0c9064368
-Ocaf-SampleSchema: ad696002-5b34-11d1-b5ba-00a0c9064368
-!
-! standard attributes
-!
-MDTV-Standard.Description: Standard Document Version 1.0
-MDTV-Standard.FileExtension: std
-MDTV-Standard.StoragePlugin: ad696000-5b34-11d1-b5ba-00a0c9064368
-MDTV-Standard.RetrievalPlugin: ad696001-5b34-11d1-b5ba-00a0c9064368
-MDTV-StandardSchema: ad696002-5b34-11d1-b5ba-00a0c9064368 
+formatlist:XmlOcaf|BinOcaf
 !
 ! XmlOcaf format
 !
index 4ce5ce6..940c21a 100755 (executable)
@@ -137,7 +137,7 @@ BOOL COcafApp::IsViewExisting(CDocument * pDoc, CRuntimeClass * pViewClass, CVie
 void COcafApp::OnFileOpen() 
 {
        CFileDialog aDlg(TRUE, NULL, NULL, OFN_FILEMUSTEXIST|OFN_HIDEREADONLY,
-          L"OCAFSample(STD) (*.std)|*.std|OCAFSample(XML) (*.xml)|*.xml|OCAFSample(Binary) (*.cbf)|*.cbf||");
+          L"OCAFSample(Binary) (*.cbf)|*.cbf|OCAFSample(XML) (*.xml)|*.xml||");
 
        if (aDlg.DoModal() != IDOK) 
         return;
index c9096d0..acd6e09 100755 (executable)
@@ -69,7 +69,7 @@ COcafDoc::~COcafDoc()
        Handle(TOcaf_Application) OcafApp = ((COcafApp*)AfxGetApp())->GetApp();
  
        // Create a new Ocaf document
-       OcafApp->NewDocument("MDTV-Standard",myOcafDoc);
+       OcafApp->NewDocument("BinOcaf",myOcafDoc);
        TPrsStd_AISViewer::New(myOcafDoc->Main(),myViewer);
  
        Handle(AIS_InteractiveContext) CTX;
@@ -87,7 +87,7 @@ COcafDoc::~COcafDoc()
  Handle(TOcaf_Application) OcafApp= ((COcafApp*)AfxGetApp())->GetApp(); \n\
   \n\
  //  Creating the new document \n\
- OcafApp->NewDocument(\"Ocaf-Sample\", myOcafDoc); \n\
+ OcafApp->NewDocument(\"BinOcaf\", myOcafDoc); \n\
   \n\
  //  Creation of a new TPrsStd_AISViewer connected to the current V3d_Viewer\n\
  TPrsStd_AISViewer::New(myOcafDoc->Main(),myViewer); \n\
@@ -904,17 +904,13 @@ void COcafDoc::OnFileSaveAs()
        CString Filter;
 
        if (TPathName.SearchFromEnd(".xml") > 0){
-               Filter = "OCAFSample(XML) (*.xml)|*.xml|OCAFSample(STD) (*.std)|*.std|OCAFSample(Binary) (*.cbf)|*.cbf||";
-       }
-       else if (TPathName.SearchFromEnd(".cbf") > 0){
-               Filter = "OCAFSample(Binary) (*.cbf)|*.cbf|OCAFSample(STD) (*.std)|*.std|OCAFSample(XML) (*.xml)|*.xml||";
-       }
-       else{
-               Filter = "OCAFSample(STD) (*.std)|*.std|OCAFSample(XML) (*.xml)|*.xml|OCAFSample(Binary) (*.cbf)|*.cbf||";
+               Filter = "OCAFSample(XML) (*.xml)|*.xml|OCAFSample(Binary) (*.cbf)|*.cbf||";
+       } else {
+               Filter = "OCAFSample(Binary) (*.cbf)|*.cbf|OCAFSample(XML) (*.xml)|*.xml||";
        }
        
        CFileDialog dlg(FALSE,
-                       L"std",
+                       L"cbf",
                        GetTitle(),
                        OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
                        Filter,
@@ -944,11 +940,6 @@ void COcafDoc::OnFileSaveAs()
                        // The document must be saved in binary format
                        myOcafDoc->ChangeStorageFormat("BinOcaf");
                }
-               else
-               {
-                       // The document must be saved in standard format
-                       myOcafDoc->ChangeStorageFormat("MDTV-Standard");
-               }
 
                try
                {
@@ -1005,11 +996,6 @@ void COcafDoc::OnFileSave()
                        // The document must be saved in binary format
                        myOcafDoc->ChangeStorageFormat("BinOcaf");
                }
-               else
-               {
-                       // The document must be saved in standard format
-                       myOcafDoc->ChangeStorageFormat("MDTV-Standard");
-               }
 
                try
                {
@@ -1038,10 +1024,10 @@ m_App->SaveAs(myOcafDoc,(TCollection_ExtendedString) TPath); \n\
        }
 
        CFileDialog dlg(FALSE,
-                       L"std",
+                       L"cbf",
                        GetTitle(),
                        OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
-                       L"OCAFSample(STD) (*.std)|*.std|OCAFSample(XML) (*.xml)|*.xml|OCAFSample(Binary) (*.cbf)|*.cbf||",
+                       L"OCAFSample(Binary) (*.cbf)|*.cbf|OCAFSample(XML) (*.xml)|*.xml||",
                        NULL );
 
        if (dlg.DoModal() != IDOK) return;
@@ -1065,11 +1051,6 @@ m_App->SaveAs(myOcafDoc,(TCollection_ExtendedString) TPath); \n\
          // The document must be saved in binary format
          myOcafDoc->ChangeStorageFormat("BinOcaf");
        }
-       else
-       {
-               // The document must be saved in standard format
-               myOcafDoc->ChangeStorageFormat("Ocaf-Sample");
-       }
 
    try
    {
index 9c2709d..8ad4f83 100755 (executable)
@@ -44,12 +44,9 @@ TOcaf_Application::TOcaf_Application()
 //=======================================================================
 
 void TOcaf_Application::Formats(TColStd_SequenceOfExtendedString& Formats) 
-{  
-  //Formats.Append(TCollection_ExtendedString ("Ocaf-Sample"));    
-  Formats.Append(TCollection_ExtendedString ("MDTV-Standard"));
+{
   Formats.Append(TCollection_ExtendedString("BinOcaf"));
   Formats.Append(TCollection_ExtendedString("XmlOcaf"));
-
 }