Example #1
0
CRopeKeyframe::~CRopeKeyframe()
{
	// Release transmit state ownership.
	SetStartPoint( NULL, 0 );
	SetEndPoint( NULL, 0 );
	SetParent( NULL, 0 );
}
Example #2
0
//============================================================================
//		NCGShading::SetStartEndPoints : Set the start/end points.
//----------------------------------------------------------------------------
void NCGShading::SetStartEndPoints(const NRectangle &theRect, NPosition startPos, NPosition endPos)
{


	// Update our state
	SetStartPoint(theRect.GetPoint(startPos));
	SetEndPoint(  theRect.GetPoint(endPos));
}
Example #3
0
// ============================================================================
// ============================================================================
bool Vista2DLine::Init(float nPosX1, float nPosY1, float nPosX2, float nPosY2, unsigned char nRed, unsigned char nGreen, unsigned char nBlue)
{
	bool success = SetStartPoint(nPosX1, nPosY1);
	success &= SetEndPoint(nPosX2,nPosY2);
	success &= SetColor(nRed,nGreen,nBlue);
	m_bIsInitialized = success;
	return success;
}
Example #4
0
void CRopeKeyframe::Activate()
{
	BaseClass::Activate();
	
	if( !m_bCreatedFromMapFile )
		return;

	// Legacy support..
	if ( m_iRopeMaterialModelIndex == -1 )
	{
		m_iRopeMaterialModelIndex = PrecacheModel( "cable/cable.vmt" );
	}

	// Find the next entity in our chain.
	CBaseEntity *pEnt = gEntList.FindEntityByName( NULL, m_iNextLinkName );
	if( pEnt && pEnt->edict() )
	{
		SetEndPoint( pEnt );

		if( m_spawnflags & SF_ROPE_RESIZE )
			m_RopeFlags |= ROPE_RESIZE;
	}
	else
	{
		// If we're from the map file, and we don't have a target ent, and 
		// "Start Dangling" wasn't set, then this rope keyframe doesn't have
		// any rope coming out of it.
		if ( m_fLockedPoints & (int)ROPE_LOCK_END_POINT )
		{
			m_RopeFlags &= ~ROPE_SIMULATE;
		}
	}

	// By default, our start point is our own entity.
	SetStartPoint( this );

	// If we don't do this here, then when we save/load, we won't "own" the transmit 
	// state of our parent, so the client might get our entity without our parent entity.
	SetParent( GetParent(), GetParentAttachment() );

	EndpointsChanged();

	Init();
}
Example #5
0
int main(int argc, char ** argv)
{
    QString volcR10("C:/develop/$sync/GFZ/data/VTK XML data/Volcano 2 topo.vtp");


    auto object = Loader::readFile(
        volcR10
        );

    double bounds[6];
    auto & dataSet = *object->dataSet();
    dataSet.GetBounds(bounds);

    vtkVector2d A{ bounds[0], 0 };
    vtkVector2d B{ bounds[1], 0 };

    auto inputPolyData = dynamic_cast<PolyDataObject *>(object.get());

    auto selector = vtkSmartPointer<LineOnCellsSelector2D>::New();
    selector->SetInputData(&dataSet);
    selector->SetCellCentersConnection(inputPolyData->cellCentersOutputPort());
    selector->SetStartPoint(A);
    selector->SetEndPoint(B);

    //auto extractSelection = vtkSmartPointer<vtkExtractSelectedPolyDataIds>::New();
    //extractSelection->SetInputData(&dataSet);
    //extractSelection->SetInputConnection(1, selector->GetOutputPort());

    //extractSelection->Update();

    //auto vPoly = extractSelection->GetOutput();

    //auto extractSelection = vtkSmartPointer<vtkExtractSelection>::New();
    //extractSelection->SetInputData(&dataSet);
    //extractSelection->SetSelectionConnection(selector->GetOutputPort());
    //extractSelection->Update();
    //auto outputData = vtkUnstructuredGrid::SafeDownCast(extractSelection->GetOutput());

    //auto vPoly = vtkSmartPointer<vtkPolyData>::New();
    //vPoly->SetPoints(outputData->GetPoints());
    //vPoly->SetPolys(outputData->GetCells());
    //vPoly->GetCellData()->PassData(outputData->GetCellData());
    //vPoly->GetPointData()->PassData(outputData->GetPointData());

    selector->Update();
    auto vPoly = selector->GetExtractedPoints();

    auto poly = std::make_unique<PolyDataObject>("extraction", *vPoly);

    QApplication app(argc, argv);

    ColorMappingChooser cmc;
    cmc.show();
    RenderConfigWidget rcw;
    rcw.show();
    RendererConfigWidget rrcw;
    rrcw.show();

    DataSetHandler dsh;
    DataMapping dm(dsh);
    auto view = dm.openInRenderView({ poly.get(), object.get() });

    auto pointsVis = dynamic_cast<RenderedPolyData *>(view->visualizationFor(poly.get()));
    pointsVis->mainActor()->GetProperty()->SetPointSize(5);
    pointsVis->mainActor()->PickableOn();

    auto baseVis = dynamic_cast<RenderedPolyData *>(view->visualizationFor(object.get()));
    baseVis->mainActor()->GetProperty()->SetOpacity(0.2);
    baseVis->mainActor()->PickableOff();

    view->show();
    cmc.setCurrentRenderView(view);
    rcw.setCurrentRenderView(view);
    rcw.setSelectedData(poly.get());
    rrcw.setCurrentRenderView(view);

    return app.exec();
}
Example #6
0
void CSearchMap::SetStartPoint(MapPoint p, int move_max)
{
	SetStartPoint(p.x, p.y, move_max);
}