]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
clean1
authorDUC ANH HOANG <dh77501n@dsp1043837>
Thu, 20 Jun 2024 11:17:24 +0000 (13:17 +0200)
committerDUC ANH HOANG <dh77501n@dsp1043837>
Thu, 20 Jun 2024 11:17:24 +0000 (13:17 +0200)
src/SPV3D/SPV3D_CADSelection.cxx
src/SPV3D/SPV3D_ViewModel.cxx

index 5849227de4239123c45cd72c56ce24fa23cf430f..3567848c627fcac15bafcbaaa677de8b83dd174a 100644 (file)
@@ -40,6 +40,9 @@
 
 #include <QDebug>
 
+#include "SPV3D_Prs.h"
+
+
 
 //-----------------------------------------------------------------------------
 SPV3D_CADSelection::SPV3D_CADSelection(QObject *parent,
@@ -289,22 +292,21 @@ void SPV3D_CADSelection::onMouseMove()
 
 
   // Retrieve the wanted information property
-  vtkSMProperty* selectedIDProperty =
+  vtkSMProperty* PreselectedIDProperty =
     proxyRepresentation->GetProperty("PreSelectedID");
-  if (!selectedIDProperty)
+  if (!PreselectedIDProperty)
   {
     qWarning()<< "The representation named '" << proxyRepresentation->GetXMLName()<< "' didn't have a property named 'SelectedIDInfo'.";
     return;
   }
 
   // Force to update the information property
-  proxyRepresentation->UpdatePropertyInformation(selectedIDProperty);
+  proxyRepresentation->UpdatePropertyInformation(PreselectedIDProperty);
 
-  //vtkIdType PreSelectedID =
-  //  vtkSMPropertyHelper(proxyRepresentation,"PreSelectedID").GetAsInt(0);
+  vtkIdType PreSelectedID =
+    vtkSMPropertyHelper(proxyRepresentation,"PreSelectedID").GetAsInt(0);
+  std::cout << "entry from client: "<< SPV3D_Prs::FromVtkIdToEntry(PreSelectedID)<< std::endl;
   
-  //std::cout << "PreSelectedID: "<< PreSelectedID<< std::endl;
-  //
 }
 
 //-----------------------------------------------------------------------------
index d00ea859a05a051aacf89ca55095905c247661e0..8471c2663925f5c7b9ada83fd48258ec6193316e 100644 (file)
@@ -235,35 +235,6 @@ void SPV3D_ViewModel::Display( const SALOME_PV3DPrs* prs )
   {
     std::cout<< "Can't update PV presentation pipeline"<< std::endl;
   }
-  /*
-  
-  if(const SPV3D_Prs* aPrs = dynamic_cast<const SPV3D_Prs*>( prs ))
-  {
-    if( !aPrs->GetRepresentation() )
-    {
-      pqObjectBuilder *builder(pqApplicationCore::instance()->getObjectBuilder());
-      pqActiveObjects::instance().setActiveView(getView());
-      pqPipelineSource *mySourceProducer = aPrs->GetSourceProducer();
-      aPrs->SetSourceProducer( mySourceProducer );
-      pqDataRepresentation* myRepr(builder->createDataRepresentation(mySourceProducer->getOutputPort(0),getView(),"CADRepresentation"));//"GeometryRepresentation"
-      vtkSMViewProxy::RepresentationVisibilityChanged(myRepr->getViewProxy(), myRepr->getProxy(), true);
-
-      aPrs->SetRepresentation(myRepr);
-    }
-    pqDataRepresentation* myRepr = aPrs->GetRepresentation();
-
-    myRepr->setVisible(1);
-    vtkSMPVRepresentationProxy* proxy(dynamic_cast<vtkSMPVRepresentationProxy*>(myRepr->getProxy()));
-    if(proxy)
-    {
-      vtkSMPropertyHelper inputHelper(proxy, "Input");
-      vtkSMSourceProxy* input = vtkSMSourceProxy::SafeDownCast(inputHelper.GetAsProxy());
-      input->UpdatePipeline();
-    }
-    getView()->resetDisplay();
-    getView()->render();
-  }
-  */
 }
 
 /*!
@@ -279,14 +250,8 @@ void SPV3D_ViewModel::Erase( const SALOME_PV3DPrs* prs, const bool /*forced*/ )
       return;
     aPrs->hide();
     updatePVPrsPipeline(aPrs);
-    ////aPrs->GetRepresentation()->setVisible(0);
-    ////aPrs->GetRepresentation()->setVisible(1);
-    ////
     getView()->resetDisplay();
     getView()->render();
-    //pqObjectBuilder* builder = pqApplicationCore::instance()->getObjectBuilder();
-    //pqServer* activeServer = pqActiveObjects::instance().activeServer();
-    //builder->destroySources(activeServer);
   }
 }