// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void VisualizeGBCDGMT::readFilterParameters(AbstractFilterParametersReader* reader, int index) { reader->openFilterGroup(this, index); setGBCDArrayPath(reader->readDataArrayPath("GBCDArrayPath", getGBCDArrayPath())); setCrystalStructuresArrayPath(reader->readDataArrayPath("CrystalStructuresArrayPath", getCrystalStructuresArrayPath())); setOutputFile(reader->readString("OutputFile", getOutputFile())); setMisorientationRotation(reader->readAxisAngle("MisorientationRotation", getMisorientationRotation(), -1) ); setPhaseOfInterest(reader->readValue("PhaseOfInterest", getPhaseOfInterest())); reader->closeFilterGroup(); }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void VisualizeGBCDPoleFigure::dataCheck() { setErrorCondition(0); getDataContainerArray()->getPrereqGeometryFromDataContainer<TriangleGeom, AbstractFilter>(this, getGBCDArrayPath().getDataContainerName()); if (getOutputFile().isEmpty() == true) { QString ss = QObject::tr( "The output file must be set"); setErrorCondition(-1000); notifyErrorMessage(getHumanLabel(), ss, getErrorCondition()); } QFileInfo fi(getOutputFile()); QDir parentPath = fi.path(); if (parentPath.exists() == false && getInPreflight()) { QString ss = QObject::tr( "The directory path for the output file does not exist. DREAM.3D will attempt to create this path during execution of the filter"); notifyWarningMessage(getHumanLabel(), ss, -1); } if (fi.suffix().compare("") == 0) { setOutputFile(getOutputFile().append(".vtk")); } QVector<size_t> cDims(1, 1); m_CrystalStructuresPtr = getDataContainerArray()->getPrereqArrayFromPath<DataArray<unsigned int>, AbstractFilter>(this, getCrystalStructuresArrayPath(), cDims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */ if (NULL != m_CrystalStructuresPtr.lock().get()) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */ { m_CrystalStructures = m_CrystalStructuresPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */ IDataArray::Pointer tmpGBCDPtr = getDataContainerArray()->getPrereqIDataArrayFromPath<IDataArray, AbstractFilter>(this, getGBCDArrayPath()); if(getErrorCondition() < 0) { return; } if (NULL != tmpGBCDPtr.get()) { QVector<size_t> cDims = tmpGBCDPtr->getComponentDimensions(); m_GBCDPtr = getDataContainerArray()->getPrereqArrayFromPath<DataArray<double>, AbstractFilter>(this, getGBCDArrayPath(), cDims); /* Assigns the shared_ptr<> to an instance variable that is a weak_ptr<> */ if( NULL != m_GBCDPtr.lock().get() ) /* Validate the Weak Pointer wraps a non-NULL pointer to a DataArray<T> object */ { m_GBCD = m_GBCDPtr.lock()->getPointer(0); } /* Now assign the raw pointer to data from the DataArray<T> object */ } if (NULL != m_GBCDPtr.lock().get() && getPhaseOfInterest() >= m_GBCDPtr.lock()->getNumberOfTuples()) { QString ss = QObject::tr("The phase index is larger than the number of Ensembles").arg(ClassName()); setErrorCondition(-1); notifyErrorMessage(getHumanLabel(), ss, getErrorCondition()); } }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void VisualizeGBCDGMT::setupFilterParameters() { FilterParameterVector parameters; parameters.push_back(IntFilterParameter::New("Phase of Interest", "PhaseOfInterest", getPhaseOfInterest(), FilterParameter::Parameter)); parameters.push_back(AxisAngleFilterParameter::New("Misorientation Axis-Angle", "MisorientationRotation", getMisorientationRotation(), FilterParameter::Parameter)); parameters.push_back(OutputFileFilterParameter::New("Output GMT File", "OutputFile", getOutputFile(), FilterParameter::Parameter, "*.dat", "DAT File")); parameters.push_back(SeparatorFilterParameter::New("Face Ensemble Data", FilterParameter::RequiredArray)); { DataArraySelectionFilterParameter::RequirementType req = DataArraySelectionFilterParameter::CreateRequirement(DREAM3D::TypeNames::Double, DREAM3D::Defaults::AnyComponentSize, DREAM3D::AttributeMatrixType::FaceEnsemble, DREAM3D::GeometryType::TriangleGeometry); parameters.push_back(DataArraySelectionFilterParameter::New("GBCD", "GBCDArrayPath", getGBCDArrayPath(), FilterParameter::RequiredArray, req)); } { DataArraySelectionFilterParameter::RequirementType req; parameters.push_back(DataArraySelectionFilterParameter::New("Crystal Structures", "CrystalStructuresArrayPath", getCrystalStructuresArrayPath(), FilterParameter::RequiredArray, req)); } setFilterParameters(parameters); }