I want to have a class which contain a visualizer on a cloud point. here is my code:
class my_vis
{
void vis_func ()
{
pcl::visualization::PCLVisualizer *vis ;
vis = new pcl::visualization::PCLVisualizer("octree viewer");
// this "vis" is just used in this function and no other place
}
void execute(){
//Start visualizer in a thread
boost::thread* visThread = new boost::thread(boost::bind(&my_vis::vis_func, this));
// bla bla
}
}
int main ()
{
my_vis vis1();
vis1.execute();
my_vis vis2();
vis2.execute();
std::getchar();
return 0 ;
}
now I have a class of visualizers which can be instantiated in "main". when I made just one instance from the class "my_vis" every thing is OK when the program runs. But I need two or more instances. and when I initialize more than one instance, an error occured: BLOCK_TYPE_IS_VALID I think that it is because of using threads. But threading is necessary in my project.
Would you please help me? Thanks a lot for your patient and help :)
P.S. I am using PCL 1.7