当前位置: 首页>>代码示例>>C++>>正文


C++ View::GetType方法代码示例

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


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

示例1: DrawLine

void CameraObject::DrawLine( double x1, double y1, double x2, double y2, double color[4] )
{
    double start[3];
    start[0] = x1;
    start[1] = y1;
    start[2] = zMin;
    double end[3];
    end[0] = x2;
    end[1] = y2;
    end[2] = zMin;

    PerViewElementCont::iterator it = m_perViewElements.begin();
    while( it != m_perViewElements.end() )
    {
        View * v = (*it).first;
        if( v->GetType() == THREED_VIEW_TYPE )
        {
            vtkProp3D * line = SimplePropCreator::CreateLine( start, end, color );
            line->SetUserTransform( m_imageTransform );
            GetCurrentRenderer(v)->AddViewProp( line );
            PerViewElements & elem = (*it).second;
            elem.anotations.push_back( line );
        }
        ++it;
    }
}
开发者ID:IbisNeuronav,项目名称:Ibis,代码行数:26,代码来源:cameraobject.cpp

示例2: SetTexture

void PolyDataObject::SetTexture( vtkImageData * texImage )
{
    // standard set code
    if( this->Texture )
        this->Texture->UnRegister( this );
    this->Texture = texImage;
    if( this->Texture )
        this->Texture->Register( this );

    // update texture in actor
    PolyDataObjectViewAssociation::iterator it = this->polydataObjectInstances.begin();
    for( ; it != this->polydataObjectInstances.end(); ++it )
    {
        View * view = (*it).first;
        if( view->GetType() == THREED_VIEW_TYPE )
        {
            vtkSmartPointer<vtkActor> actor = (*it).second;
            vtkTexture * tex = actor->GetTexture();
            if( tex )
            {
                if( this->Texture )
                    tex->SetInputData( this->Texture );
                else
                    tex->SetInputData( this->checkerBoardTexture );
            }
        }
    }

    emit ObjectModified();
}
开发者ID:IbisNeuronav,项目名称:Ibis,代码行数:30,代码来源:polydataobject.cpp

示例3: Show

void PolyDataObject::Show()
{
    PolyDataObjectViewAssociation::iterator it = this->polydataObjectInstances.begin();
    for( ; it != this->polydataObjectInstances.end(); ++it )
    {
        View * v = (*it).first;
        vtkSmartPointer<vtkActor> actor = (*it).second;
        if( v->GetType() == THREED_VIEW_TYPE || GetCrossSectionVisible() )
            actor->VisibilityOn();
    }
    emit ObjectModified();
}
开发者ID:IbisNeuronav,项目名称:Ibis,代码行数:12,代码来源:polydataobject.cpp

示例4: ClearDrawing

void CameraObject::ClearDrawing()
{
    PerViewElementCont::iterator it = m_perViewElements.begin();
    while( it != m_perViewElements.end() )
    {
        View * v = (*it).first;
        if( v->GetType() == THREED_VIEW_TYPE )
        {
            ClearDrawingOneView( v, (*it).second );
        }
        ++it;
    }
}
开发者ID:IbisNeuronav,项目名称:Ibis,代码行数:13,代码来源:cameraobject.cpp

示例5: SetCrossSectionVisible

void PolyDataObject::SetCrossSectionVisible( bool showCrossSection )
{
    this->CrossSectionVisible = showCrossSection;
    if( IsHidden() )
        return;

    PolyDataObjectViewAssociation::iterator it = this->polydataObjectInstances.begin();
    for( ; it != this->polydataObjectInstances.end(); ++it )
    {
        View * v = (*it).first;
        vtkSmartPointer<vtkActor> actor = (*it).second;
        if( v->GetType() != THREED_VIEW_TYPE )
            actor->SetVisibility( showCrossSection ? 1 : 0 );
    }
    emit ObjectModified();
}
开发者ID:IbisNeuronav,项目名称:Ibis,代码行数:16,代码来源:polydataobject.cpp

示例6: InternalDrawPath

void CameraObject::InternalDrawPath( std::vector< Vec3 > & p3d, double color[4] )
{
    PerViewElementCont::iterator it = m_perViewElements.begin();
    while( it != m_perViewElements.end() )
    {
        View * v = (*it).first;
        if( v->GetType() == THREED_VIEW_TYPE )
        {
            vtkProp3D * line = SimplePropCreator::CreatePath( p3d, color );
            line->SetUserTransform( m_imageTransform );
            GetCurrentRenderer(v)->AddViewProp( line );
            PerViewElements & elem = (*it).second;
            elem.anotations.push_back( line );
        }
        ++it;
    }
}
开发者ID:IbisNeuronav,项目名称:Ibis,代码行数:17,代码来源:cameraobject.cpp

示例7: DrawTarget

void CameraObject::DrawTarget( double x, double y, double radius, double color[4] )
{
    double center[3] = { 0.0, 0.0, 0.0 };
    center[0] = x;
    center[1] = y;
    PerViewElementCont::iterator it = m_perViewElements.begin();
    while( it != m_perViewElements.end() )
    {
        View * v = (*it).first;
        if( v->GetType() == THREED_VIEW_TYPE )
        {
            vtkProp3D * p1 = SimplePropCreator::CreateTarget( center, 10.0, color );
            p1->SetUserTransform( m_imageTransform );
            GetCurrentRenderer(v)->AddViewProp( p1 );
            PerViewElements & elem = (*it).second;
            elem.anotations.push_back( p1 );
        }
        ++it;
    }
}
开发者ID:IbisNeuronav,项目名称:Ibis,代码行数:20,代码来源:cameraobject.cpp

示例8: SetShowTexture

void PolyDataObject::SetShowTexture( bool show )
{
    this->showTexture = show;

    if( show )
    {
        // Create the default texture if needed
        if( !this->Texture && !this->checkerBoardTexture )
        {
            int size = 200;
            int squareSize = 5;
            this->checkerBoardTexture = vtkSmartPointer<vtkImageData>::New();
            this->checkerBoardTexture->SetDimensions( size, size, 1 );
            this->checkerBoardTexture->AllocateScalars(VTK_UNSIGNED_CHAR, 1);
            unsigned char * row = (unsigned char*) this->checkerBoardTexture->GetScalarPointer();
            for( int y = 0; y < size; ++y )
            {
                unsigned char * col = row;
                for( int x = 0; x < size; ++x )
                {
                    bool xOn = ( x / squareSize % 2 ) == 0;
                    bool yOn = ( y / squareSize % 2 ) == 0;
                    if( xOn == yOn )
                        *col = 255;
                    else
                        *col = 160;
                    ++col;
                }
                row += size;
            }
        }

        vtkImageData * texture = this->Texture;
        if( !texture )
            texture = this->checkerBoardTexture;

        // Add a vtkTexture to each actor to map the checker board onto object
        View * view = 0;
        vtkSmartPointer<vtkActor> actor;
        PolyDataObjectViewAssociation::iterator it = this->polydataObjectInstances.begin();
        for( ; it != this->polydataObjectInstances.end(); ++it )
        {
            view = (*it).first;
            if( view->GetType() == THREED_VIEW_TYPE )
            {
                actor = (*it).second;
                vtkTexture * tex = vtkTexture::New();
                tex->SetBlendingMode( vtkTexture::VTK_TEXTURE_BLENDING_MODE_MODULATE );
                tex->InterpolateOff();
                tex->RepeatOn();
                tex->SetInputData( texture );
                actor->SetTexture( tex );
                tex->Delete();
            }
        }
    }
    else
    {
        // remove texture from each of the actors
        View * view = 0;
        vtkSmartPointer<vtkActor> actor;
        PolyDataObjectViewAssociation::iterator it = this->polydataObjectInstances.begin();
        for( ; it != this->polydataObjectInstances.end(); ++it )
        {
            view = (*it).first;
            if( view->GetType() == THREED_VIEW_TYPE )
            {
                actor = (*it).second;
                actor->SetTexture( 0 );
            }
        }
    }
    this->UpdatePipeline();
    emit ObjectModified();
}
开发者ID:IbisNeuronav,项目名称:Ibis,代码行数:75,代码来源:polydataobject.cpp


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