-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvtkHideCubeCallback.h
55 lines (46 loc) · 1.08 KB
/
vtkHideCubeCallback.h
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef VTK_HIDE_CUBE_CALLBACK_
#define VTK_HIDE_CUBE_CALLBACK_
#include "vtkCommand.h"
#include "vtkObject.h"
#include "vtkBoxWidget.h"
#include "vtkActor.h"
#include "vtkCubeSource.h"
#include <log4cpp/Category.hh>
#include <log4cpp/PropertyConfigurator.hh>
/*
*在使用这个类的时候,一定要把cubeActor传进来
*/
class vtkHideCubeCallback:public vtkCommand
{
public:
static vtkHideCubeCallback* New()
{
return new vtkHideCubeCallback;
}
virtual void Execute(vtkObject *caller, unsigned long ev,
void *callData)
{
log4cpp::Category& rootLog = log4cpp::Category::getRoot();
log4cpp::Category& subLog = log4cpp::Category::getInstance(std::string("sub1"));
if(ev == vtkCommand::DisableEvent||ev == vtkCommand::StartInteractionEvent)
{
if(cubeActor != 0)
{
cubeActor->VisibilityOff();
}else
{
rootLog.error("vtkHideCubeCallback:cubeActor没有设置");
subLog.error("vtkHideCubeCallback:cubeActor没有设置");
}
}
}
void setObject(vtkActor* ca)
{
cubeActor = ca;
}
protected:
vtkHideCubeCallback(){};
private:
vtkActor* cubeActor;
};
#endif