-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCriticalPoint.cpp
More file actions
40 lines (33 loc) · 1.39 KB
/
CriticalPoint.cpp
File metadata and controls
40 lines (33 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* File: CriticalPoint.cpp
* Author: zoizoi
*
* Created on 22 May 2011, 11:13
*/
#include "CriticalPoint.h"
CriticalPoint::CriticalPoint(int _x,int _y, int _z,int _step, float _value, int _xDim, int _yDim, int _zDim):x(_x),y(_y),z(_z),step(_step),value(_value),xDim(_xDim) ,yDim(_yDim),zDim(_zDim){
actor=vtkSmartPointer<vtkActor>::New();
vtkSmartPointer<vtkSphereSource> sphereSource = vtkSmartPointer<vtkSphereSource>::New();
float interestRadius=0.03;
sphereSource->SetCenter(getXFloat(), getYFloat(), getZFloat());
sphereSource->SetRadius(interestRadius);
sphereSource->SetPhiResolution(20);
sphereSource->SetThetaResolution(20);
sphereSource->Update();
vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
mapper->SetInputConnection(sphereSource->GetOutputPort());
actor = vtkSmartPointer<vtkActor>::New();
actor->SetMapper(mapper);
actor->GetProperty()->SetAmbient(1); //SetShading(0);
actor->GetProperty()->SetDiffuse(0); //SetShading(0);
actor->GetProperty()->SetSpecular(0); //SetShading(0);
actor->GetProperty()->SetInterpolationToFlat(); //actor->GetProperty()->SetOpacity(0.5);
actor->GetProperty()->SetColor(1, 0, 0);
}
CriticalPoint::CriticalPoint(const CriticalPoint& orig) {
}
CriticalPoint::~CriticalPoint() {
}
vtkSmartPointer<vtkActor> CriticalPoint::getActor(){
return actor;
}