10 #include <vtkSphereSource.h> 11 #include <vtkPolyDataMapper.h> 26 vtkSmartPointer<vtkCamera> cam = ren->GetActiveCamera();
27 cam->GetFrustumPlanes(ren->GetTiledAspectRatio(), planes);
29 cam->GetClippingRange(clip);
38 cam->GetPosition(position);
40 cam->GetDirectionOfProjection(dir);
44 std::vector<lvr2::BaseVector<float> > centroids;
45 std::vector<size_t> indices;
49 double scale = cam->GetParallelScale();
51 cam->SetParallelScale(1.0);
53 double planes_high[24];
54 cam->GetFrustumPlanes(ren->GetTiledAspectRatio(), planes_high);
56 cam->SetParallelScale(scale);
57 cam->SetClippingRange(clip[0], clip[1]);
58 std::vector<lvr2::BaseVector<float> > centroids2;
59 std::vector<size_t> indices2;
64 for(
size_t i = 0; i < centroids2.size(); ++i)
66 highResArea.
expand(centroids2[i]);
94 for(
size_t i = 0; i < indices.size(); ++i)
96 lowRes.at(indices[i])->VisibilityOn();
100 for(
auto& it: highRes)
102 if(std::find(indices2.begin(), indices2.end(), it.first) != indices2.end())
106 it.second->VisibilityOn();
108 if(lowRes.size() > 0)
110 lowRes.at(it.first)->VisibilityOff();
117 it.second->VisibilityOff();
std::unordered_map< size_t, vtkSmartPointer< vtkActor > > getHighResActors()
void expand(T v)
Expands the bounding box if the given Vector v} is outside the current volume.
virtual double Cull(vtkRenderer *ren, vtkProp **propList, int &listLength, int &initialized) override
void fetchHighRes(BoundingBox< BaseVector< float > > bb, std::vector< size_t > indices, std::vector< BaseVector< float >> centroids)
A dynamic bounding box class.
void getActors(double planes[24], std::vector< BaseVector< float > > ¢roids, std::vector< size_t > &indices)
std::unordered_map< size_t, vtkSmartPointer< vtkActor > > getLowResActors()
LVRChunkedMeshBridge * m_bridge