#include "FITKCFDPostGlyph.h" #include "FITKAlgGlyph.h" #include "FITK_Kernel/FITKAppFramework/FITKAppFramework.h" #include "FITK_Kernel/FITKAppFramework/FITKGlobalData.h" #include "FITK_Interface/FITKInterfaceCFDPost/FITKCFDPostData.h" #include "FITK_Interface/FITKInterfaceCFDPost/FITKCFDPost3DManager.h" #include namespace Interface { FITKCFDPostGlyph::FITKCFDPostGlyph(int parentID) { _CFDPostParentID = parentID; Interface::FITKCFDPost3DManager* dataManger = FITKAPP->getGlobalData()->getPostData()->getPostDataManager(); if (dataManger == nullptr)return; Interface::FITKAbstractCFDPostData* parentData = dataManger->getDataByID(_CFDPostParentID); if (parentData == nullptr)return; _glyphAlg = FITKAlgGlyph::New(); _glyphAlg->SetInputConnection(parentData->getOutputPort()); vtkDataSetMapper* mapper = vtkDataSetMapper::New(); mapper->SetInputConnection(_glyphAlg->GetOutputPort()); _mappers.append(mapper); } FITKCFDPostGlyph::~FITKCFDPostGlyph() { if (_glyphAlg) { _glyphAlg->Delete(); _glyphAlg = nullptr; } } FITKPostDataType FITKCFDPostGlyph::getPostDataType() { return FITKPostDataType::Post_Glyph; } vtkDataSet* FITKCFDPostGlyph::getOutput() { if (_glyphAlg == nullptr)return nullptr; return _glyphAlg->GetOutput(); } vtkAlgorithmOutput* FITKCFDPostGlyph::getOutputPort() { if (_glyphAlg == nullptr)return nullptr; return _glyphAlg->GetOutputPort(); } void FITKCFDPostGlyph::update() { if (_glyphAlg == nullptr)return; _glyphAlg->Modified(); _glyphAlg->setvectorName(_vectorName); _glyphAlg->settipResolution(_tipResolution); _glyphAlg->settipRadius(_tipRadius); _glyphAlg->settipLength(_tipLength); _glyphAlg->setshaftResolution(_shaftResolution); _glyphAlg->setshaftRadius(_shaftRadius); _glyphAlg->setscaleFactor(_scaleFactor); _glyphAlg->setpointDataUsed(_pointDataUsed); _glyphAlg->setpointNum(_pointNum); _glyphAlg->setmaxNumber(_maxNumber); _glyphAlg->setscaleMode(_scaleMode); _glyphAlg->Update(); FITKAbstractCFDPostData::update(); } }