Salome HOME
Minor: removing annoying print message
[modules/paravis.git] / src / Plugins / MedReader / ParaViewPlugin / vtkSMMedGroupSelectionDomain.cxx
1 // Copyright (C) 2010-2013  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #include "vtkSMMedGroupSelectionDomain.h"
21
22 #include "vtkObjectFactory.h"
23 #include "vtkSMStringVectorProperty.h"
24 #include "vtkStringList.h"
25
26 #include <string>
27 using std::string;
28
29 vtkStandardNewMacro(vtkSMMedGroupSelectionDomain);
30
31 vtkSMMedGroupSelectionDomain::vtkSMMedGroupSelectionDomain()
32 {
33 }
34
35 vtkSMMedGroupSelectionDomain::~vtkSMMedGroupSelectionDomain()
36 {
37 }
38
39 int vtkSMMedGroupSelectionDomain::SetDefaultValues(vtkSMProperty* prop)
40 {
41   vtkSMStringVectorProperty* svp = vtkSMStringVectorProperty::SafeDownCast(prop);
42   if(!svp || this->GetNumberOfRequiredProperties() == 0)
43     {
44     return this->Superclass::SetDefaultValues(prop);
45     }
46
47   // info property has default values
48   vtkSMStringVectorProperty* isvp = vtkSMStringVectorProperty::SafeDownCast(
49     prop->GetInformationProperty());
50   if (isvp)
51     {
52     vtkStringList* proplist = vtkStringList::New();
53     svp->SetNumberOfElements(0);
54     svp->SetNumberOfElementsPerCommand(2);
55     for(int id=0; id<isvp->GetNumberOfElements(); id++)
56       {
57       string elem = isvp->GetElement(id);
58       proplist->AddString(elem.c_str());
59       if(elem.find("/OnCell/") != string::npos)
60         {
61         proplist->AddString("1");
62         }
63       else
64         {
65         proplist->AddString("0");
66         }
67       }
68     svp->SetElements(proplist);
69     proplist->Delete();
70     }
71
72   return 1;
73 }
74
75 void vtkSMMedGroupSelectionDomain::PrintSelf(ostream& os, vtkIndent indent)
76 {
77   this->Superclass::PrintSelf(os, indent);
78 }