1 // Copyright (C) 2010-2013 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #include "vtkSMMedGroupSelectionDomain.h"
22 #include "vtkObjectFactory.h"
23 #include "vtkSMStringVectorProperty.h"
24 #include "vtkStringList.h"
29 vtkStandardNewMacro(vtkSMMedGroupSelectionDomain);
31 vtkSMMedGroupSelectionDomain::vtkSMMedGroupSelectionDomain()
35 vtkSMMedGroupSelectionDomain::~vtkSMMedGroupSelectionDomain()
39 int vtkSMMedGroupSelectionDomain::SetDefaultValues(vtkSMProperty* prop)
41 vtkSMStringVectorProperty* svp = vtkSMStringVectorProperty::SafeDownCast(prop);
42 if(!svp || this->GetNumberOfRequiredProperties() == 0)
44 return this->Superclass::SetDefaultValues(prop);
47 // info property has default values
48 vtkSMStringVectorProperty* isvp = vtkSMStringVectorProperty::SafeDownCast(
49 prop->GetInformationProperty());
52 vtkStringList* proplist = vtkStringList::New();
53 svp->SetNumberOfElements(0);
54 svp->SetNumberOfElementsPerCommand(2);
55 for(int id=0; id<isvp->GetNumberOfElements(); id++)
57 string elem = isvp->GetElement(id);
58 proplist->AddString(elem.c_str());
59 if(elem.find("/OnCell/") != string::npos)
61 proplist->AddString("1");
65 proplist->AddString("0");
68 svp->SetElements(proplist);
75 void vtkSMMedGroupSelectionDomain::PrintSelf(ostream& os, vtkIndent indent)
77 this->Superclass::PrintSelf(os, indent);