Primjena biblioteke VTK u vizualizaciji znanstvenih podataka - Pmf
Primjena biblioteke VTK u vizualizaciji znanstvenih podataka - Pmf
Primjena biblioteke VTK u vizualizaciji znanstvenih podataka - Pmf
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>VTK</strong>vis3Dmain.cxx<br />
#include "CommandInterpretation.h"<br />
#include "Message.h"<br />
#include "vtkMySaveCallback.h"<br />
#include <br />
#include <br />
#include <br />
#include <br />
#include <br />
#include <br />
#include <br />
#include <br />
#include <br />
#include <br />
#include <br />
#include <br />
#include <br />
#include <br />
#include <br />
#include <br />
int main( int argc, const char* argv[] )<br />
{<br />
CommandInterpretation *command=new CommandInterpretation(argc, argv);<br />
//NEPOZNATA NAREDBA<br />
if(command->isUnknown())<br />
Message::exitError("Nepoznati parametri. Pokrenite program sa opcijom -h za pomoc.");<br />
//HELP<br />
if(command->isHelp())<br />
{<br />
Message::help();<br />
return 0;<br />
}<br />
vtkPolyDataMapper *mapp=vtkPolyDataMapper::New();<br />
vtkMySaveCallback *save=vtkMySaveCallback::New();<br />
//CITANJE IZ TXT DATOTEKE<br />
if(command->isFileTxt())<br />
{<br />
//txt datoteku citamo pomocu vtkSimplePointsReader<br />
vtkSimplePointsReader *simpleReader=vtkSimplePointsReader::New();<br />
simpleReader->SetFileName(command->getFileName());<br />
double bounds[6];<br />
simpleReader->Update();<br />
simpleReader->GetOutput()->GetBounds(bounds);<br />
//tockama se dodjeljuju skalarne vrijednosti pomocu vtkElevationFilter-a<br />
vtkElevationFilter *elf=vtkElevationFilter::New();<br />
elf->SetInputConnection(simpleReader->GetOutputPort());<br />
elf->SetLowPoint(0,0,bounds[4]);<br />
elf->SetHighPoint(0,0,bounds[5]);<br />
28