• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ vtkSmartPointer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中vtkSmartPointer的典型用法代码示例。如果您正苦于以下问题:C++ vtkSmartPointer类的具体用法?C++ vtkSmartPointer怎么用?C++ vtkSmartPointer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了vtkSmartPointer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1:

vtkSmartPointer<vtkArrayType> FlowAnalysis::vtkMakeArray(const vtkSmartPointer<vtkUniformGrid>& grid, const string& name, size_t numComponents, bool fillZero){
	auto arr=vtkSmartPointer<vtkArrayType>::New();
	arr->SetNumberOfComponents(numComponents);
	arr->SetNumberOfTuples(boxCells.prod());
	arr->SetName(name.c_str());
	if(cellData) grid->GetCellData()->AddArray(arr);
	else grid->GetPointData()->AddArray(arr);
	if(fillZero){ for(int _i=0; _i<(int)numComponents; _i++) arr->FillComponent(_i,0.); }
	return arr;
}
开发者ID:CrazyHeex,项目名称:woo,代码行数:10,代码来源:FlowAnalysis.cpp


示例2: GetColumsWithString

std::vector<std::string> GetColumsWithString( std::string colName, vtkSmartPointer<vtkTable> table ){
	std::vector<std::string> retVect;
	for( int i=0; i<table->GetNumberOfColumns(); ++i ){
		std::string current_column;
		current_column = table->GetColumnName(i);
		if( current_column.find(colName.c_str()) != std::string::npos ){
			retVect.push_back( current_column );
		}
	}
	return retVect;	
}
开发者ID:RoysamLab,项目名称:STrend,代码行数:11,代码来源:ftkUtils.cpp


示例3: setActiveEdgeActor

void FieldDataVisualizer::setActiveEdgeActor(vtkSmartPointer<vtkActor>& _edgeActor) {
	//Edge vis
	vtkSmartPointer<vtkExtractEdges> edgeExtractorTemp = vtkExtractEdges::New();
	edgeExtractorTemp->SetInputData(warpFilter->GetUnstructuredGridOutput());
	vtkSmartPointer<vtkPolyDataMapper> edgeMapperTemp = vtkPolyDataMapper::New();
	edgeMapperTemp->SetInputConnection(edgeExtractorTemp->GetOutputPort());
	_edgeActor->SetMapper(edgeMapperTemp);
	_edgeActor->GetProperty()->SetColor(0., 0., 0.);
	_edgeActor->GetProperty()->SetLineWidth(3);
	edgeMapperTemp->ScalarVisibilityOff();
}
开发者ID:DrStS,项目名称:STACCATO,代码行数:11,代码来源:FieldDataVisualizer.cpp


示例4: VtkWriter

 VtkWriter(const std::string &data_path, bool write_binary = true) :
         m_file_counter(0),
         m_data_path(data_path),
         m_writer(vtkSmartPointer<vtk_writer_type>::New()),
         m_write_binary(write_binary)
 {
     vtksys::SystemTools::MakeDirectory(data_path.c_str());
     if (m_write_binary)
         m_writer->SetDataModeToBinary();
     else
         m_writer->SetDataModeToAscii();
 }
开发者ID:macundo,项目名称:moops,代码行数:12,代码来源:write_vtu.hpp


示例5: setActiveHueLut

void FieldDataVisualizer::setActiveHueLut(vtkSmartPointer<vtkLookupTable>& _hueLut) {
	double scalarRange[2];
	myHMeshToVtkUnstructuredGrid->getVtkUnstructuredGrid()->GetPointData()->GetScalars()->GetRange(scalarRange);
	mySelectedMapper->UseLookupTableScalarRangeOn();
	// Create a lookup table to share between the mapper and the scalarbar
	_hueLut->SetTableRange(scalarRange[0], scalarRange[1]);
	_hueLut->SetHueRange(0.667, 0.0);
	_hueLut->SetValueRange(1, 1);
	_hueLut->Build();

	mySelectedMapper->SetLookupTable(_hueLut);
}
开发者ID:DrStS,项目名称:STACCATO,代码行数:12,代码来源:FieldDataVisualizer.cpp


示例6: Append

//Update the features in this table whose names match (sets doFeat)
void AssociativeFeatureCalculator::Append(vtkSmartPointer<vtkTable> table)
{
	//Compute features:
	ftk::NuclearAssociationRules *assoc;
	if( inputs_set ){
		assoc = new ftk::NuclearAssociationRules("",0,lab_im, inp_im);
		assoc->AddAssociation( input_association->GetRuleName(), "", input_association->GetOutDistance(), input_association->GetInDistance(),	input_association->IsUseWholeObject(), input_association->IsUseBackgroundSubtraction(), input_association->IsUseMultiLevelThresholding(), input_association->GetNumberOfThresholds(), input_association->GetNumberIncludedInForeground(), input_association->GetAssocType(), input_association->get_path() );
	}
	else{
		assoc = new ftk::NuclearAssociationRules("",0);
		assoc->ReadRulesFromXML(inFilename);
	}
	assoc->PrintSelf();
	assoc->Compute();	

	//Init the table (headers):
	for (int i=0; i < assoc->GetNumofAssocRules(); ++i)
	{
		vtkSmartPointer<vtkDoubleArray> column = vtkSmartPointer<vtkDoubleArray>::New();
		column->SetName( (fPrefix+assoc->GetAssociationRules().at(i).GetRuleName()).c_str() );
		column->SetNumberOfValues( table->GetNumberOfRows() );
		table->AddColumn(column);
	}

	//Now update the table:
	std::vector<unsigned short> labels = assoc->GetLabels();
	float** vals = assoc->GetAssocFeaturesList();
	//#pragma omp parallel for num_threads(4)
	for (int i=0; i<(int)labels.size(); ++i)
	{
		unsigned short id = labels.at(i);
		if(id == 0) continue;

		int row = -1;
		for(int r=0; r<table->GetNumberOfRows(); ++r)
		{
			if( table->GetValue(r,0) == id )
			{
				row = r;
				break;
			}
		}

		if(row == -1) continue;

		for (int f=0; f<assoc->GetNumofAssocRules(); ++f)
		{
			table->SetValueByName(row,(fPrefix+assoc->GetAssociationRules().at(f).GetRuleName()).c_str(), vtkVariant(vals[f][i]));
		}
	}
	delete assoc;
}
开发者ID:JumperWang,项目名称:farsight-clone,代码行数:53,代码来源:ftkNuclearAssociationRules.cpp


示例7:

void cv::viz::vtkImageMatSource::copyGrayImage(const Mat &source, vtkSmartPointer<vtkImageData> output)
{
    unsigned char* dptr = reinterpret_cast<unsigned char*>(output->GetScalarPointer());
    size_t elem_step = output->GetIncrements()[1]/sizeof(unsigned char);

    for (int y = 0; y < source.rows; ++y)
    {
        unsigned char* drow = dptr + elem_step * y;
        const unsigned char *srow = source.ptr<unsigned char>(y);
        for (int x = 0; x < source.cols; ++x)
            drow[x] = *srow++;
    }
}
开发者ID:cyberCBM,项目名称:DetectO,代码行数:13,代码来源:vtkImageMatSource.cpp


示例8: AppendTables

vtkSmartPointer<vtkTable> AppendTables(vtkSmartPointer<vtkTable> table_initial,vtkSmartPointer<vtkTable> table_new )
{
	/*!
	* Adds on table to the end of another
	*/
  //!fill the table with values
  unsigned int counter = 0;
  for(vtkIdType r = 0; r < table_new->GetNumberOfRows() ; r++ )
    {
	  table_initial->InsertNextRow(table_new->GetRow(r));
    }

	return table_initial;
}
开发者ID:RoysamLab,项目名称:STrend,代码行数:14,代码来源:ftkUtils.cpp


示例9: sizeof

template <typename PointT> void 
pcl::visualization::PointCloudGeometryHandlerXYZ<PointT>::getGeometry (vtkSmartPointer<vtkPoints> &points) const
{
  if (!capable_)
    return;

  if (!points)
    points = vtkSmartPointer<vtkPoints>::New ();
  points->SetDataTypeToFloat ();

  vtkSmartPointer<vtkFloatArray> data = vtkSmartPointer<vtkFloatArray>::New ();
  data->SetNumberOfComponents (3);
  vtkIdType nr_points = cloud_->points.size ();

  // Add all points
  vtkIdType j = 0;    // true point index
  float* pts = static_cast<float*> (malloc (nr_points * 3 * sizeof (float)));

  // If the dataset has no invalid values, just copy all of them
  if (cloud_->is_dense)
  {
    for (vtkIdType i = 0; i < nr_points; ++i)
    {
      pts[i * 3 + 0] = cloud_->points[i].x;
      pts[i * 3 + 1] = cloud_->points[i].y;
      pts[i * 3 + 2] = cloud_->points[i].z;
    }
    data->SetArray (&pts[0], nr_points * 3, 0);
    points->SetData (data);
  }
  // Need to check for NaNs, Infs, ec
  else
  {
    for (vtkIdType i = 0; i < nr_points; ++i)
    {
      // Check if the point is invalid
      if (!pcl_isfinite (cloud_->points[i].x) || !pcl_isfinite (cloud_->points[i].y) || !pcl_isfinite (cloud_->points[i].z))
        continue;

      pts[j * 3 + 0] = cloud_->points[i].x;
      pts[j * 3 + 1] = cloud_->points[i].y;
      pts[j * 3 + 2] = cloud_->points[i].z;
      // Set j and increment
      j++;
    }
    data->SetArray (&pts[0], j * 3, 0);
    points->SetData (data);
  }
}
开发者ID:kalectro,项目名称:pcl_groovy,代码行数:49,代码来源:point_cloud_handlers.hpp


示例10:

void CDialog_subSTL::OnBnClickedButton4() //scaled
{
	vtkSmartPointer<vtkQuadricDecimation> decimate = vtkSmartPointer<vtkQuadricDecimation>::New();//scale method in VTK 
    decimate->SetInputConnection(STLReader->GetOutputPort());
    decimate->Update();
    vtkSmartPointer<vtkPolyData> decimated = vtkSmartPointer<vtkPolyData>::New();
    decimated->ShallowCopy(decimate->GetOutput());
	vtkSmartPointer<vtkSTLWriter> stlWriter = vtkSmartPointer<vtkSTLWriter>::New();
    stlWriter->SetFileName("test_saled.stl");
    stlWriter->SetInput(decimated); //stlWriter->SetInput(map->GetOutput());
    stlWriter->Write();
	MessageBox(_T("Scaled Done"));
	renderWindowInteractor_STL->GetRenderWindow()->Finalize(); // close renderwindow
	renderWindowInteractor_STL->TerminateApp();
}
开发者ID:nazib,项目名称:2D-3DRegistration,代码行数:15,代码来源:Dialog_subSTL.cpp


示例11: return

template <typename PointT> bool
pcl::visualization::PointCloudColorHandlerRandom<PointT>::getColor (vtkSmartPointer<vtkDataArray> &scalars) const
{
  if (!capable_ || !cloud_)
    return (false);

  if (!scalars)
    scalars = vtkSmartPointer<vtkUnsignedCharArray>::New ();
  scalars->SetNumberOfComponents (3);
  
  vtkIdType nr_points = cloud_->points.size ();
  reinterpret_cast<vtkUnsignedCharArray*>(&(*scalars))->SetNumberOfTuples (nr_points);

  // Get a random color
  unsigned char* colors = new unsigned char[nr_points * 3];
  double r, g, b;
  pcl::visualization::getRandomColors (r, g, b);

  int r_ = static_cast<int> (pcl_lrint (r * 255.0)), 
      g_ = static_cast<int> (pcl_lrint (g * 255.0)), 
      b_ = static_cast<int> (pcl_lrint (b * 255.0));

  // Color every point
  for (vtkIdType cp = 0; cp < nr_points; ++cp)
  {
    colors[cp * 3 + 0] = static_cast<unsigned char> (r_);
    colors[cp * 3 + 1] = static_cast<unsigned char> (g_);
    colors[cp * 3 + 2] = static_cast<unsigned char> (b_);
  }
  reinterpret_cast<vtkUnsignedCharArray*>(&(*scalars))->SetArray (colors, 3 * nr_points, 0, vtkUnsignedCharArray::VTK_DATA_ARRAY_DELETE);
  return (true);
}
开发者ID:2php,项目名称:pcl,代码行数:32,代码来源:point_cloud_color_handlers.hpp


示例12: return

template <typename PointT> bool
pcl::visualization::PointCloudColorHandlerCustom<PointT>::getColor (vtkSmartPointer<vtkDataArray> &scalars) const
{
  if (!capable_ || !cloud_)
    return (false);

  if (!scalars)
    scalars = vtkSmartPointer<vtkUnsignedCharArray>::New ();
  scalars->SetNumberOfComponents (3);
  
  vtkIdType nr_points = cloud_->points.size ();
  reinterpret_cast<vtkUnsignedCharArray*>(&(*scalars))->SetNumberOfTuples (nr_points);

  // Get a random color
  unsigned char* colors = new unsigned char[nr_points * 3];

  // Color every point
  for (vtkIdType cp = 0; cp < nr_points; ++cp)
  {
    colors[cp * 3 + 0] = static_cast<unsigned char> (r_);
    colors[cp * 3 + 1] = static_cast<unsigned char> (g_);
    colors[cp * 3 + 2] = static_cast<unsigned char> (b_);
  }
  reinterpret_cast<vtkUnsignedCharArray*>(&(*scalars))->SetArray (colors, 3 * nr_points, 0);
  return (true);
}
开发者ID:AlexSchwank,项目名称:pcl,代码行数:26,代码来源:point_cloud_color_handlers.hpp


示例13: getVoxelActors

void
getVoxelActors (pcl::PointCloud<pcl::PointXYZ>& voxelCenters,
                 double voxelSideLen, Eigen::Vector3f color,
                 vtkSmartPointer<vtkActorCollection> coll)
{
  vtkSmartPointer < vtkAppendPolyData > treeWireframe = vtkSmartPointer<vtkAppendPolyData>::New ();
  
  double s = voxelSideLen/2.0;
  
  for (const auto &point : voxelCenters.points)
  {
    double x = point.x;
    double y = point.y;
    double z = point.z;
    
    treeWireframe->AddInputData (getCuboid (x - s, x + s, y - s, y + s, z - s, z + s));
  }

  vtkSmartPointer < vtkLODActor > treeActor = vtkSmartPointer<vtkLODActor>::New ();
  
  vtkSmartPointer < vtkDataSetMapper > mapper = vtkSmartPointer<vtkDataSetMapper>::New ();
  mapper->SetInputData (treeWireframe->GetOutput ());

  treeActor->SetMapper (mapper);
  
  treeActor->GetProperty ()->SetRepresentationToWireframe ();
  treeActor->GetProperty ()->SetColor (color[0], color[1], color[2]);
  treeActor->GetProperty ()->SetLineWidth (4);
  coll->AddItem (treeActor);
}
开发者ID:VictorLamoine,项目名称:pcl,代码行数:30,代码来源:voxel_grid_occlusion_estimation.cpp


示例14:

template <typename PointT> void
pcl::visualization::PointCloudColorHandlerRandom<PointT>::getColor (vtkSmartPointer<vtkDataArray> &scalars) const
{
  if (!capable_)
    return;

  if (!scalars)
    scalars = vtkSmartPointer<vtkUnsignedCharArray>::New ();
  scalars->SetNumberOfComponents (3);
  
  vtkIdType nr_points = cloud_->points.size ();
  reinterpret_cast<vtkUnsignedCharArray*>(&(*scalars))->SetNumberOfTuples (nr_points);

  // Get a random color
  unsigned char* colors = new unsigned char[nr_points * 3];
  double r, g, b;
  pcl::visualization::getRandomColors (r, g, b);

  int r_ = pcl_lrint (r * 255.0), g_ = pcl_lrint (g * 255.0), b_ = pcl_lrint (b * 255.0);

  // Color every point
  for (vtkIdType cp = 0; cp < nr_points; ++cp)
  {
    colors[cp * 3 + 0] = r_;
    colors[cp * 3 + 1] = g_;
    colors[cp * 3 + 2] = b_;
  }
  reinterpret_cast<vtkUnsignedCharArray*>(&(*scalars))->SetArray (colors, 3 * nr_points, 0);
}
开发者ID:gimlids,项目名称:BodyScanner,代码行数:29,代码来源:point_cloud_handlers.hpp


示例15: return

bool
pcl::visualization::PointCloudColorHandlerRandom<pcl::PCLPointCloud2>::getColor (vtkSmartPointer<vtkDataArray> &scalars) const
{
  if (!capable_ || !cloud_)
    return (false);
  
  if (!scalars)
    scalars = vtkSmartPointer<vtkUnsignedCharArray>::New ();
  scalars->SetNumberOfComponents (3);
  
  vtkIdType nr_points = cloud_->width * cloud_->height;
  reinterpret_cast<vtkUnsignedCharArray*>(&(*scalars))->SetNumberOfTuples (nr_points);
  
  // Get a random color
  unsigned char* colors = new unsigned char[nr_points * 3];
  double r, g, b;
  pcl::visualization::getRandomColors (r, g, b);
  
  long r_ = pcl_lrint (r * 255.0), g_ = pcl_lrint (g * 255.0), b_ = pcl_lrint (b * 255.0);

  // Color every point
  for (vtkIdType cp = 0; cp < nr_points; ++cp)
  {
    colors[cp * 3 + 0] = static_cast<unsigned char> (r_);
    colors[cp * 3 + 1] = static_cast<unsigned char> (g_);
    colors[cp * 3 + 2] = static_cast<unsigned char> (b_);
  }
  reinterpret_cast<vtkUnsignedCharArray*>(&(*scalars))->SetArray (colors, 3 * nr_points, 0);
  return (true);
}
开发者ID:Alex-van-der-Peet,项目名称:pcl,代码行数:30,代码来源:point_cloud_handlers.cpp


示例16:

///
///	Given a buffer of scalar values, compute a histogram
/// using VTK
///
vtkSmartPointer<vtkImageAccumulate>
RenderPanel::ComputeHistogram(vtkSmartPointer<vtkFloatArray> scalars,
                              int numScalars,
                              double range[2])
{
    // Compute a histogram for the curvs values
    vtkSmartPointer<vtkImageData> scalarData = vtkSmartPointer<vtkImageData>::New();
    vtkSmartPointer<vtkImageImport> scalarImport = vtkSmartPointer<vtkImageImport>::New();

    scalarImport->SetDataOrigin(0, 0, 0);
    scalarImport->SetWholeExtent(0, numScalars - 1, 0, 0, 0, 0);
    scalarImport->SetDataExtentToWholeExtent();
    scalarImport->SetDataScalarTypeToFloat();
    scalarImport->SetNumberOfScalarComponents(1);
    scalarImport->SetImportVoidPointer(scalars->GetPointer(0));

    vtkSmartPointer<vtkImageExtractComponents> extract = vtkSmartPointer<vtkImageExtractComponents>::New();
    extract->SetInputConnection( scalarImport->GetOutputPort() );
    extract->SetComponents( 0 );
    extract->Update();

    extract->GetOutput()->GetScalarRange(range);

    vtkSmartPointer<vtkImageAccumulate> histogram = vtkSmartPointer<vtkImageAccumulate>::New();
    histogram->SetInputConnection( extract->GetOutputPort() );
	histogram->SetComponentExtent( 0, 1000, 0, 0, 0, 0 );
	histogram->SetComponentOrigin( range[0],0,0 );
    histogram->SetComponentSpacing( (range[1] - range[0]) / 1000.0f, 0, 0 );
   
    histogram->Update();

    return histogram;
}
开发者ID:zkaufman,项目名称:freesurfer,代码行数:37,代码来源:RenderPanel.cpp


示例17: getColor

                /** \brief Obtain the actual color for the input dataset as vtk scalars.
      * \param[out] scalars the output scalars containing the color for the dataset
      * \return true if the operation was successful (the handler is capable and
      * the input cloud was given as a valid pointer), false otherwise
      */
                virtual bool
                getColor (vtkSmartPointer<vtkDataArray> &scalars) const
                {
                    if (!capable_ || !cloud_)
                        return (false);

                    if (!scalars)
                        scalars = vtkSmartPointer<vtkUnsignedCharArray>::New ();
                    scalars->SetNumberOfComponents (3);

                    vtkIdType nr_points = vtkIdType (cloud_->points.size ());
                    reinterpret_cast<vtkUnsignedCharArray*>(&(*scalars))->SetNumberOfTuples (nr_points);
                    unsigned char* colors = reinterpret_cast<vtkUnsignedCharArray*>(&(*scalars))->GetPointer (0);

                    // Color every point
                    if (nr_points != int (rgb_->points.size ()))
                        std::fill (colors, colors + nr_points * 3, static_cast<unsigned char> (0xFF));
                    else
                        for (vtkIdType cp = 0; cp < nr_points; ++cp)
                        {
                            int idx = cp * 3;
                            colors[idx + 0] = rgb_->points[cp].r;
                            colors[idx + 1] = rgb_->points[cp].g;
                            colors[idx + 2] = rgb_->points[cp].b;
                        }
                    return (true);
                }
开发者ID:Hirucon,项目名称:KinfuSuperRes,代码行数:32,代码来源:point_cloud_color_handler_rgb_cloud.hpp


示例18: Initialize

void vmtkRenderer::Initialize(vtkSmartPointer<vtkRenderWindow> renw)
{
	
	Renderer = vtkSmartPointer<vtkRenderer>::New();

	RenderWindow = renw;
	double *color =new double[3];
	color[0] = 0.0;
	color[1] = 0.1;
	color[2] = 0.3;
	Renderer->SetBackground(color);

	RenderWindowInteractor = renw->GetInteractor();
	
	interactorCamera = vtkSmartPointer<vtkvmtkInteractorStyleTrackballCamera>::New();

	//ÄܸıäÑÕÉ«
	//Renderer->SetBackground();

	RenderWindow->AddRenderer(Renderer);

	//RenderWindow->SetSize();

	//RenderWindow->SetPointSmoothing();

	//RenderWindow->SetLineSmoothing();
	
	//RenderWindow->SetPolygonSmoothing();
	//renw->SetSize(800,600);
	RenderWindowInteractor->SetInteractorStyle(interactorCamera);
	//RenderWindowInteractor->SetRenderWindow(renw);



}
开发者ID:bleachzou3,项目名称:VASCULAR,代码行数:35,代码来源:vmtkRenderer.cpp


示例19: setUserTrans

void NonRigid::setUserTrans(vtkSmartPointer<vtkMatrix4x4> mat)
{
    if (!temp_mesh_vec.empty())
    {
        // convert vertices to eigen 4*n matrix
        Eigen::MatrixXd v_mat(4, temp_mesh_vec.size()/3);
        v_mat << Eigen::Map<Eigen::MatrixXd>(&temp_mesh_vec[0], 3, temp_mesh_vec.size()/3), Eigen::RowVectorXd::Ones(temp_mesh_vec.size()/3);

        // set transform
        Eigen::Matrix4d trans_mat;
        for (size_t i = 0; i < 4; ++i)
        {
            for (size_t j = 0; j < 4; ++j)
            {
                trans_mat(i, j) = mat->GetElement(i, j);
            }
        }

        Eigen::MatrixXd new_v_mat = trans_mat * v_mat;
        temp_mesh_vec.clear();
        for (size_t i = 0; i < new_v_mat.cols(); ++i)
        {
            temp_mesh_vec.push_back(new_v_mat(0, i)/new_v_mat(3, i));
            temp_mesh_vec.push_back(new_v_mat(1, i)/new_v_mat(3, i));
            temp_mesh_vec.push_back(new_v_mat(2, i)/new_v_mat(3, i));
        }
    }
}
开发者ID:zhuangfangwang,项目名称:cranioviewer,代码行数:28,代码来源:NonRigid.cpp


示例20: vtk_draw_view2

void vtk_draw_view2(vtkSmartPointer<vtkRenderWindow> renderWindow,vtkSmartPointer<vtkRenderWindowInteractor> interactor)
{
  vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
  renderWindow->AddRenderer(renderer);
  Renderers[1]=renderer;
  //renderer->RemoveLight( renderer->GetLights()->GetNextItem());
  vtkSmartPointer<vtkLight> light = vtkSmartPointer<vtkLight>::New();
  light->SetLightTypeToSceneLight();
  light->SetPosition(100, 100, 100);
  light->SetFocalPoint(-100,-100,-100); 
  light->SetColor(0.5,0.5,0);
  light->SetPositional(true); // required for vtkLightActor below
  renderer->AddLight(light);
  renderer->UpdateLightsGeometryToFollowCamera();
  light->SetSwitch(false);
  // light->SetConeAngle(10);
  // light->SetFocalPoint(lightFocalPoint[0], lightFocalPoint[1], lightFocalPoint[2]);
  // light->SetDiffuseColor(1,0,0);
  // light->SetAmbientColor(0,1,0);
  // light->SetSpecularColor(0,0,1);
  
  renderer->SetBackground(0.1, 0.2, 0.4);

  renderer->SetViewport(xmins[1],ymins[1],xmaxs[1],ymaxs[1]);
  
  //  m_source.m_display->draw_normal_points(renderer);
  m_source.m_display->draw_triangle(renderer,interactor);

  renderer->GetActiveCamera()->SetParallelProjection(1);
    
  renderer->ResetCamera();

  // renderWindow->Render();
}
开发者ID:ricther,项目名称:reconstruction_program,代码行数:34,代码来源:main.cpp



注:本文中的vtkSmartPointer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ vvi类代码示例发布时间:2022-05-31
下一篇:
C++ vsx_texture类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap