set(classes
vtkElectromagnetismRotation
- vtkPVMetaDataInformation
+ vtkPVMetaDataInformationERIO
)
vtk_module_add_module(ElectromagnetismRotationIO
+++ /dev/null
-// Copyright (C) 2021 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// Author : Anthony Geay
-
-#include "vtkPVMetaDataInformation.h"
-
-#include "vtkAlgorithm.h"
-#include "vtkAlgorithmOutput.h"
-#include "vtkClientServerStream.h"
-#include "vtkExecutive.h"
-#include "vtkDataObject.h"
-#include "vtkGenericDataObjectReader.h"
-#include "vtkGenericDataObjectWriter.h"
-#include "vtkInformationDataObjectMetaDataKey.h"
-#include "vtkInformation.h"
-#include "vtkObjectFactory.h"
-
-#include "MEDCouplingRefCountObject.hxx"
-
-#include <sstream>
-
-vtkStandardNewMacro(vtkPVMetaDataInformation);
-vtkCxxSetObjectMacro(vtkPVMetaDataInformation, InformationData, vtkDataObject);
-
-static vtkInformationDataObjectMetaDataKey* GetMEDReaderMetaDataIfAny()
-{
- static const char ZE_KEY[] = "vtkMEDReader::META_DATA";
- MEDCoupling::GlobalDict* gd(MEDCoupling::GlobalDict::GetInstance());
- if (!gd->hasKey(ZE_KEY))
- return 0;
- std::string ptSt(gd->value(ZE_KEY));
- void* pt(0);
- std::istringstream iss(ptSt);
- iss >> pt;
- return reinterpret_cast<vtkInformationDataObjectMetaDataKey*>(pt);
-}
-
-//----------------------------------------------------------------------------
-vtkPVMetaDataInformation::vtkPVMetaDataInformation()
-{
- this->InformationData = NULL;
-}
-
-//----------------------------------------------------------------------------
-vtkPVMetaDataInformation::~vtkPVMetaDataInformation()
-{
- this->SetInformationData(NULL);
-}
-
-//----------------------------------------------------------------------------
-void vtkPVMetaDataInformation::CopyFromObject(vtkObject* obj)
-{
- this->SetInformationData(NULL);
-
- vtkAlgorithmOutput* algOutput = vtkAlgorithmOutput::SafeDownCast(obj);
- if (!algOutput)
- {
- vtkAlgorithm* alg = vtkAlgorithm::SafeDownCast(obj);
- if (alg)
- {
- algOutput = alg->GetOutputPort(0);
- }
-
- }
- if (!algOutput)
- {
- vtkErrorMacro("Information can only be gathered from a vtkAlgorithmOutput.");
- return;
- }
-
- vtkAlgorithm* reader = algOutput->GetProducer();
- vtkInformation* info = reader->GetExecutive()->GetOutputInformation(
- algOutput->GetIndex());
-
- if (info && info->Has(GetMEDReaderMetaDataIfAny()))
- {
- this->SetInformationData(vtkDataObject::SafeDownCast(info->Get(GetMEDReaderMetaDataIfAny())));
- }
-}
-
-//----------------------------------------------------------------------------
-void vtkPVMetaDataInformation::CopyToStream(vtkClientServerStream* css)
-{
- css->Reset();
- if (!this->InformationData)
- {
- *css << vtkClientServerStream::Reply
- << vtkClientServerStream::InsertArray(
- static_cast<unsigned char*>(NULL), 0)
- << vtkClientServerStream::End;
- return;
- }
-
- vtkDataObject* clone = this->InformationData->NewInstance();
- clone->ShallowCopy(this->InformationData);
-
- vtkGenericDataObjectWriter* writer = vtkGenericDataObjectWriter::New();
- writer->SetFileTypeToBinary();
- writer->WriteToOutputStringOn();
- writer->SetInputData(clone);
- writer->Write();
-
- *css << vtkClientServerStream::Reply
- << vtkClientServerStream::InsertArray(
- writer->GetBinaryOutputString(),
- writer->GetOutputStringLength())
- << vtkClientServerStream::End;
- writer->RemoveAllInputs();
- writer->Delete();
- clone->Delete();
-}
-
-//----------------------------------------------------------------------------
-void vtkPVMetaDataInformation::CopyFromStream(const vtkClientServerStream* css)
-{
- this->SetInformationData(0);
- vtkTypeUInt32 length;
- if (css->GetArgumentLength(0, 0, &length) && length > 0)
- {
- unsigned char* raw_data = new unsigned char[length];
- css->GetArgument(0, 0, raw_data, length);
- vtkGenericDataObjectReader* reader = vtkGenericDataObjectReader::New();
- reader->SetBinaryInputString(reinterpret_cast<const char*>(raw_data), length);
- reader->ReadFromInputStringOn();
- delete []raw_data;
- reader->Update();
- this->SetInformationData(reader->GetOutput());
- reader->Delete();
- }
-}
-
-void vtkPVMetaDataInformation::AddInformation(vtkPVInformation*)
-{
-}
-
-//----------------------------------------------------------------------------
-void vtkPVMetaDataInformation::PrintSelf(ostream& os, vtkIndent indent)
-{
- this->Superclass::PrintSelf(os, indent);
- os << indent << "InformationData: " << this->InformationData << endl;
-}
+++ /dev/null
-// Copyright (C) 2021 CEA/DEN, EDF R&D
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-// Author : Anthony Geay
-
-#ifndef __vtkPVMetaDataInformation_h
-#define __vtkPVMetaDataInformation_h
-
-#include "vtkPVInformation.h"
-
-class vtkDataObject;
-class vtkInformationDataObjectKey;
-
-class VTK_EXPORT vtkPVMetaDataInformation : public vtkPVInformation
-{
-public:
- static vtkPVMetaDataInformation* New();
- vtkTypeMacro(vtkPVMetaDataInformation, vtkPVInformation);
- void PrintSelf(ostream& os, vtkIndent indent);
-
- // Description:
- // Transfer information about a single object into this object.
- virtual void CopyFromObject(vtkObject*);
-
- //BTX
- // Description:
- // Manage a serialized version of the information.
- virtual void CopyToStream(vtkClientServerStream*);
- virtual void CopyFromStream(const vtkClientServerStream*);
- virtual void AddInformation(vtkPVInformation*);
- //ETX
-
- // Description:
- // Returns the Information Data.
- vtkGetObjectMacro(InformationData, vtkDataObject);
-
-//BTX
-protected:
- vtkPVMetaDataInformation();
- ~vtkPVMetaDataInformation();
- void SetInformationData(vtkDataObject*);
- vtkDataObject* InformationData;
-
-private:
- vtkPVMetaDataInformation(const vtkPVMetaDataInformation&); // Not implemented
- void operator=(const vtkPVMetaDataInformation&); // Not implemented
-//ETX
-};
-
-#endif
--- /dev/null
+// Copyright (C) 2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Anthony Geay
+
+#include "vtkPVMetaDataInformationERIO.h"
+
+#include "vtkAlgorithm.h"
+#include "vtkAlgorithmOutput.h"
+#include "vtkClientServerStream.h"
+#include "vtkExecutive.h"
+#include "vtkDataObject.h"
+#include "vtkGenericDataObjectReader.h"
+#include "vtkGenericDataObjectWriter.h"
+#include "vtkInformationDataObjectMetaDataKey.h"
+#include "vtkInformation.h"
+#include "vtkObjectFactory.h"
+
+#include "MEDCouplingRefCountObject.hxx"
+
+#include <sstream>
+
+vtkStandardNewMacro(vtkPVMetaDataInformationERIO);
+vtkCxxSetObjectMacro(vtkPVMetaDataInformationERIO, InformationData, vtkDataObject);
+
+static vtkInformationDataObjectMetaDataKey* GetMEDReaderMetaDataIfAny()
+{
+ static const char ZE_KEY[] = "vtkMEDReader::META_DATA";
+ MEDCoupling::GlobalDict* gd(MEDCoupling::GlobalDict::GetInstance());
+ if (!gd->hasKey(ZE_KEY))
+ return 0;
+ std::string ptSt(gd->value(ZE_KEY));
+ void* pt(0);
+ std::istringstream iss(ptSt);
+ iss >> pt;
+ return reinterpret_cast<vtkInformationDataObjectMetaDataKey*>(pt);
+}
+
+//----------------------------------------------------------------------------
+vtkPVMetaDataInformationERIO::vtkPVMetaDataInformationERIO()
+{
+ this->InformationData = NULL;
+}
+
+//----------------------------------------------------------------------------
+vtkPVMetaDataInformationERIO::~vtkPVMetaDataInformationERIO()
+{
+ this->SetInformationData(NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkPVMetaDataInformationERIO::CopyFromObject(vtkObject* obj)
+{
+ this->SetInformationData(NULL);
+
+ vtkAlgorithmOutput* algOutput = vtkAlgorithmOutput::SafeDownCast(obj);
+ if (!algOutput)
+ {
+ vtkAlgorithm* alg = vtkAlgorithm::SafeDownCast(obj);
+ if (alg)
+ {
+ algOutput = alg->GetOutputPort(0);
+ }
+
+ }
+ if (!algOutput)
+ {
+ vtkErrorMacro("Information can only be gathered from a vtkAlgorithmOutput.");
+ return;
+ }
+
+ vtkAlgorithm* reader = algOutput->GetProducer();
+ vtkInformation* info = reader->GetExecutive()->GetOutputInformation(
+ algOutput->GetIndex());
+
+ if (info && info->Has(GetMEDReaderMetaDataIfAny()))
+ {
+ this->SetInformationData(vtkDataObject::SafeDownCast(info->Get(GetMEDReaderMetaDataIfAny())));
+ }
+}
+
+//----------------------------------------------------------------------------
+void vtkPVMetaDataInformationERIO::CopyToStream(vtkClientServerStream* css)
+{
+ css->Reset();
+ if (!this->InformationData)
+ {
+ *css << vtkClientServerStream::Reply
+ << vtkClientServerStream::InsertArray(
+ static_cast<unsigned char*>(NULL), 0)
+ << vtkClientServerStream::End;
+ return;
+ }
+
+ vtkDataObject* clone = this->InformationData->NewInstance();
+ clone->ShallowCopy(this->InformationData);
+
+ vtkGenericDataObjectWriter* writer = vtkGenericDataObjectWriter::New();
+ writer->SetFileTypeToBinary();
+ writer->WriteToOutputStringOn();
+ writer->SetInputData(clone);
+ writer->Write();
+
+ *css << vtkClientServerStream::Reply
+ << vtkClientServerStream::InsertArray(
+ writer->GetBinaryOutputString(),
+ writer->GetOutputStringLength())
+ << vtkClientServerStream::End;
+ writer->RemoveAllInputs();
+ writer->Delete();
+ clone->Delete();
+}
+
+//----------------------------------------------------------------------------
+void vtkPVMetaDataInformationERIO::CopyFromStream(const vtkClientServerStream* css)
+{
+ this->SetInformationData(0);
+ vtkTypeUInt32 length;
+ if (css->GetArgumentLength(0, 0, &length) && length > 0)
+ {
+ unsigned char* raw_data = new unsigned char[length];
+ css->GetArgument(0, 0, raw_data, length);
+ vtkGenericDataObjectReader* reader = vtkGenericDataObjectReader::New();
+ reader->SetBinaryInputString(reinterpret_cast<const char*>(raw_data), length);
+ reader->ReadFromInputStringOn();
+ delete []raw_data;
+ reader->Update();
+ this->SetInformationData(reader->GetOutput());
+ reader->Delete();
+ }
+}
+
+void vtkPVMetaDataInformationERIO::AddInformation(vtkPVInformation*)
+{
+}
+
+//----------------------------------------------------------------------------
+void vtkPVMetaDataInformationERIO::PrintSelf(ostream& os, vtkIndent indent)
+{
+ this->Superclass::PrintSelf(os, indent);
+ os << indent << "InformationData: " << this->InformationData << endl;
+}
--- /dev/null
+// Copyright (C) 2021 CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+// Author : Anthony Geay
+
+#ifndef __vtkPVMetaDataInformationERIO_h
+#define __vtkPVMetaDataInformationERIO_h
+
+#include "vtkPVInformation.h"
+
+class vtkDataObject;
+class vtkInformationDataObjectKey;
+
+class VTK_EXPORT vtkPVMetaDataInformationERIO : public vtkPVInformation
+{
+public:
+ static vtkPVMetaDataInformationERIO* New();
+ vtkTypeMacro(vtkPVMetaDataInformationERIO, vtkPVInformation);
+ void PrintSelf(ostream& os, vtkIndent indent);
+
+ // Description:
+ // Transfer information about a single object into this object.
+ virtual void CopyFromObject(vtkObject*);
+
+ //BTX
+ // Description:
+ // Manage a serialized version of the information.
+ virtual void CopyToStream(vtkClientServerStream*);
+ virtual void CopyFromStream(const vtkClientServerStream*);
+ virtual void AddInformation(vtkPVInformation*);
+ //ETX
+
+ // Description:
+ // Returns the Information Data.
+ vtkGetObjectMacro(InformationData, vtkDataObject);
+
+//BTX
+protected:
+ vtkPVMetaDataInformationERIO();
+ ~vtkPVMetaDataInformationERIO();
+ void SetInformationData(vtkDataObject*);
+ vtkDataObject* InformationData;
+
+private:
+ vtkPVMetaDataInformationERIO(const vtkPVMetaDataInformationERIO&); // Not implemented
+ void operator=(const vtkPVMetaDataInformationERIO&); // Not implemented
+//ETX
+};
+
+#endif
#include "pqElectroRotationGroupWidget.h"
#include "vtkElectromagnetismRotation.h"
-#include "vtkPVMetaDataInformation.h"
+#include "vtkPVMetaDataInformationERIO.h"
#include "pqTreeWidget.h"
#include "pqTreeWidgetItemObject.h"
void pqElectroRotationGroupWidget::loadTreeWidgetItems()
{
// Recover Graph
- vtkPVMetaDataInformation *info(vtkPVMetaDataInformation::New());
+ vtkPVMetaDataInformationERIO *info(vtkPVMetaDataInformationERIO::New());
this->proxy()->GatherInformation(info);
vtkGraph* graph = vtkGraph::SafeDownCast(info->GetInformationData());
if(!graph)
// Tooltip
grpItem->setData(0, Qt::ToolTipRole, name);
-
+
grpItem->setData(0, Qt::DecorationRole, QPixmap(":/ParaViewResources/Icons/pqCellData16.png"));
}
}
the streamlines will be generated.</Documentation>
</InputProperty>
- <PropertyGroup label="Seeds">
- <Property name="Source" />
- </PropertyGroup>
-
- <PropertyGroup label="Integration Parameters">
- <Property name="IntegrationDirection" />
- <Property name="IntegratorType" />
- <Property name="IntegrationStepUnit" />
- <Property name="InitialIntegrationStep" />
- <Property name="MinimumIntegrationStep" />
- <Property name="MaximumIntegrationStep" />
- <Property name="MaximumError" />
- </PropertyGroup>
-
- <PropertyGroup label="Streamline Parameters" >
- <Property name="MaximumNumberOfSteps" />
- <Property name="MaximumPropagation" />
- <Property name="TerminalSpeed" />
- </PropertyGroup>
<ShowInMenu category="Electromagnetism" />
<Visibility replace_input="2" />
</Hints>
+
+ <PropertyGroup label="Seeds">
+ <Property name="Source" />
+ </PropertyGroup>
+
+ <PropertyGroup label="Integration Parameters">
+ <Property name="IntegrationDirection" />
+ <Property name="IntegratorType" />
+ <Property name="IntegrationStepUnit" />
+ <Property name="InitialIntegrationStep" />
+ <Property name="MinimumIntegrationStep" />
+ <Property name="MaximumIntegrationStep" />
+ <Property name="MaximumError" />
+ </PropertyGroup>
+
+ <PropertyGroup label="Streamline Parameters" >
+ <Property name="MaximumNumberOfSteps" />
+ <Property name="TerminalSpeed" />
+ </PropertyGroup>
</SourceProxy>
</ProxyGroup>
</ServerManagerConfiguration>
vtkSetClampMacro(MaximumNumberOfSamplePoints, int, 1, VTK_INT_MAX);
vtkGetMacro(MaximumNumberOfSamplePoints, int);
+ static const char *GetColorArrayName();
+
+
protected:
vtkElectromagnetismVecteur();
~vtkElectromagnetismVecteur() override = default;
int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector*) override;
- static const char *GetColorArrayName();
-
double ScaleFactor;
int GlyphMode;
<Property function="Input" name="Input" />
</RequiredProperties>
</BoundsDomain>
- <ArrayRangeDomain name="scalar_range">
- <RequiredProperties>
- <Property function="Input" name="Input" />
- <Property function="ArraySelection" name="ScaleArray" />
- </RequiredProperties>
- </ArrayRangeDomain>
<ArrayRangeDomain name="vector_range">
<RequiredProperties>
<Property function="Input" name="Input" />
value="1" />
<!-- show this widget when GlyphMode==1 -->
</Hints>
- </IntVectorProperty>
+ </IntVectorProperty>
<StringVectorProperty command="SetInputArrayToProcess"
default_values="1"
Select the input array to use for orienting the glyphs.
</Documentation>
</StringVectorProperty>
-
- <StringVectorProperty
+
+ <StringVectorProperty
name="ColorArrayName"
command="GetColorArrayName"
number_of_elements="1"