// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void PerPhaseMinSize::dataCheck(bool preflight, size_t voxels, size_t fields, size_t ensembles) { setErrorCondition(0); std::stringstream ss; VoxelDataContainer* m = getVoxelDataContainer(); GET_PREREQ_DATA(m, DREAM3D, CellData, GrainIds, ss, -301, int32_t, Int32ArrayType, voxels, 1); GET_PREREQ_DATA(m, DREAM3D, CellData, CellPhases, ss, -301, int32_t, Int32ArrayType, voxels, 1); GET_PREREQ_DATA(m, DREAM3D, FieldData, FieldPhases, ss, -301, int32_t, Int32ArrayType, fields, 1); CREATE_NON_PREREQ_DATA(m, DREAM3D, FieldData, Active, ss, bool, BoolArrayType, true, fields, 1); }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void AvizoRectilinearCoordinateWriter::dataCheck(bool preflight, size_t voxels, size_t fields, size_t ensembles) { setErrorCondition(0); std::stringstream ss; VoxelDataContainer* m = getVoxelDataContainer(); if(m_OutputFile.empty() == true) { ss << "The output file must be set before executing this filter."; addErrorMessage(getHumanLabel(), ss.str(), -1); setErrorCondition(-1); } if(m_WriteGrainIds == true) { GET_PREREQ_DATA(m, DREAM3D, CellData, GrainIds, ss, -301, int32_t, Int32ArrayType, voxels, 1) } }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void QuickSolidMesh::dataCheck(bool preflight, size_t voxels, size_t fields, size_t ensembles) { setErrorCondition(0); std::stringstream ss; VoxelDataContainer* m = getVoxelDataContainer(); GET_PREREQ_DATA(m, DREAM3D, CellData, GrainIds, ss, -300, int32_t, Int32ArrayType, voxels, 1) SolidMeshDataContainer* sm = getSolidMeshDataContainer(); if (NULL == sm) { addErrorMessage(getHumanLabel(), "SolidMeshDataContainer is missing", -383); setErrorCondition(-384); } else { StructArray<Node>::Pointer vertices = StructArray<Node>::CreateArray(1, DREAM3D::CellData::SolidMeshNodes); StructArray<Tetrahedron>::Pointer tetrahedrons = StructArray<Tetrahedron>::CreateArray(1, DREAM3D::CellData::SolidMeshTetrahedrons); sm->setNodes(vertices); sm->setTetrahedrons(tetrahedrons); } }
// ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- void FindNeighbors::dataCheck(bool preflight, size_t voxels, size_t fields, size_t ensembles) { setErrorCondition(0); std::stringstream ss; VoxelDataContainer* m = getVoxelDataContainer(); // Cell Data GET_PREREQ_DATA( m, DREAM3D, CellData, GrainIds, ss, -300, int32_t, Int32ArrayType, voxels, 1) CREATE_NON_PREREQ_DATA(m, DREAM3D, CellData, SurfaceVoxels, ss, int8_t, Int8ArrayType, 0, voxels, 1) // Field Data // Do this whole block FIRST otherwise the side effect is that a call to m->getNumFieldTuples will = 0 // because we are just creating an empty NeighborList object. // Now we are going to get a "Pointer" to the NeighborList object out of the DataContainer m_NeighborList = NeighborList<int>::SafeObjectDownCast<IDataArray*, NeighborList<int>* > (m->getFieldData(m_NeighborListArrayName).get()); if(m_NeighborList == NULL) { NeighborList<int>::Pointer neighborlistPtr = NeighborList<int>::New(); neighborlistPtr->SetName(m_NeighborListArrayName); neighborlistPtr->Resize(fields); neighborlistPtr->setNumNeighborsArrayName(getNumNeighborsArrayName()); m->addFieldData(m_NeighborListArrayName, neighborlistPtr); if (neighborlistPtr.get() == NULL) { ss << "NeighborLists Array Not Initialized at Beginning of FindNeighbors Filter" << std::endl; setErrorCondition(-308); } m_NeighborList = NeighborList<int>::SafeObjectDownCast<IDataArray*, NeighborList<int>* > (m->getFieldData(m_NeighborListArrayName).get()); CreatedArrayHelpIndexEntry::Pointer e = CreatedArrayHelpIndexEntry::New(); e->setFilterName(this->getNameOfClass()); e->setFilterHumanLabel(this->getHumanLabel()); e->setFilterGroup(this->getGroupName()); e->setFilterSubGroup(this->getSubGroupName()); e->setArrayDefaultName(m_NeighborListArrayName); e->setArrayGroup("Field"); e->setArrayNumComponents(0); e->setArrayType("NeighborList"); addCreatedArrayHelpIndexEntry(e); } // And we do the same for the SharedSurfaceArea list m_SharedSurfaceAreaList = NeighborList<float>::SafeObjectDownCast<IDataArray*, NeighborList<float>*> (m->getFieldData(m_SharedSurfaceAreaListArrayName).get()); if(m_SharedSurfaceAreaList == NULL) { NeighborList<float>::Pointer sharedSurfaceAreaListPtr = NeighborList<float>::New(); sharedSurfaceAreaListPtr->SetName(m_SharedSurfaceAreaListArrayName); sharedSurfaceAreaListPtr->Resize(fields); sharedSurfaceAreaListPtr->setNumNeighborsArrayName(getNumNeighborsArrayName()); m->addFieldData(m_SharedSurfaceAreaListArrayName, sharedSurfaceAreaListPtr); if (sharedSurfaceAreaListPtr.get() == NULL) { ss.str(""); ss << "SurfaceAreaLists Array Not Initialized correctly at Beginning of FindNeighbors Filter" << std::endl; setErrorCondition(-308); addErrorMessage(getHumanLabel(), ss.str(), -308); } m_SharedSurfaceAreaList = NeighborList<float>::SafeObjectDownCast<IDataArray*, NeighborList<float>*> (m->getFieldData(m_SharedSurfaceAreaListArrayName).get()); CreatedArrayHelpIndexEntry::Pointer e = CreatedArrayHelpIndexEntry::New(); e->setFilterName(this->getNameOfClass()); e->setFilterHumanLabel(this->getHumanLabel()); e->setFilterGroup(this->getGroupName()); e->setFilterSubGroup(this->getSubGroupName()); e->setArrayDefaultName(m_SharedSurfaceAreaListArrayName); e->setArrayGroup("Field"); e->setArrayNumComponents(0); e->setArrayType("SurfaceAreaLists"); addCreatedArrayHelpIndexEntry(e); } CREATE_NON_PREREQ_DATA(m, DREAM3D, FieldData, SurfaceFields, ss, bool, BoolArrayType, false, fields, 1) CREATE_NON_PREREQ_DATA(m, DREAM3D, FieldData, NumNeighbors, ss, int32_t, Int32ArrayType, 0, fields, 1) }