コード例 #1
0
UIHierarchyCell * GraphBase::CellForNode(UIHierarchy *forHierarchy, void *node)
{
    UIHierarchyCell *c= forHierarchy->GetReusableCell("Graph cell"); //try to get cell from the reusable cells store
    if(!c)
    { 
        //if cell of requested type isn't find in the store create new cell
        int32 leftSideWidth = EditorSettings::Instance()->GetLeftPanelWidth();
        c = new UIHierarchyCell(Rect(0, 0, leftSideWidth, ControlsFactory::CELL_HEIGHT), "Graph cell");
        
        UIControl *icon = new UIControl(Rect(0, 0, ControlsFactory::CELL_HEIGHT, ControlsFactory::CELL_HEIGHT));
        icon->SetName("_Icon_");
        icon->GetBackground()->SetDrawType(UIControlBackground::DRAW_SCALE_PROPORTIONAL);
        c->text->AddControl(icon);

        UIControl *marker = new UIControl(Rect(0, 0, ControlsFactory::CELL_HEIGHT, ControlsFactory::CELL_HEIGHT));
        marker->SetName("_Marker_");
        marker->GetBackground()->SetDrawType(UIControlBackground::DRAW_SCALE_PROPORTIONAL);
        c->text->AddControl(marker);
        
        UIStaticText *text = new UIStaticText(Rect(ControlsFactory::CELL_HEIGHT, 0, leftSideWidth - ControlsFactory::CELL_HEIGHT, ControlsFactory::CELL_HEIGHT));
        Font *font = ControlsFactory::GetFont12();
        text->SetFont(font);
        text->SetAlign(ALIGN_LEFT|ALIGN_VCENTER);
        text->SetName("_Text_");
		text->SetTextColor(ControlsFactory::GetColorDark());
        c->text->AddControl(text);
    }
    
    FillCell(c, node);
    
    ControlsFactory::CustomizeExpandButton(c->openButton);
    ControlsFactory::CustomizeSceneGraphCell(c);
    
    return c;
}
コード例 #2
0
bool BaseCellContainer::Add( GI::Object *obj )
{
    long pos = ObjVisitor::Pos( obj );
    if( pos < 0 || pos >= Size() ) return false;
    if( !FillCell( pos, obj ) ) return false;
    return Super::Add( obj );
}
コード例 #3
0
void Grid::DrawWithMap(Automaton &life)
{
    for (int i=0; i<height; i++)
        for(int j=0; j<width; j++) {
            statecode cell_state = life(i,j);
            FillCell(i, j, life.State[cell_state].GetColor());
        }
}
コード例 #4
0
ファイル: graphics.cpp プロジェクト: Yuki-Inoue/qt-cell
void Grid::DrawWithMap(Automaton &a)
{
    for (int i=0; i<cellCount; i++)
        for(int j=0; j<cellCount; j++) {
            statecode cell_state = a(i,j);
	    statecode ill_state = a.getIllState();
            double lcolor[3];
	    double density = (double) cell_state / ill_state;
	    std::fill(lcolor, lcolor+3, density);
            FillCell(i, j, lcolor);
        }
}
コード例 #5
0
ファイル: OMap.cpp プロジェクト: nanzhang790/View3dn
/////////////////////////////////////////////////////////////////////////////
// Fill OHC with objects 
void COMap::FillOMapT(tOMap* m_OMap, long nObject, vertex* v, long nV, vertex* t, long nT)
{
	long idT; 
	long i;
	vertex vp[3]; // vertices of triangle primitive

	for(idT=0;idT<nT;idT++)
	{
		*(vp)=*(v+(t+idT)->p1);
		*(vp+1)=*(v+(t+idT)->p2);
		*(vp+2)=*(v+(t+idT)->p3);
		RasterAABB(vp, 3, m_idTCell, m_nCountTCell, RASTER_SIZE);
		
		for(i=0;i<m_nCountTCell;i++)
		{
			FillCell(m_OMap, nObject, idT, *(m_idTCell+i));
		}
	}
}
コード例 #6
0
ファイル: OMap.cpp プロジェクト: nanzhang790/View3dn
void COMap::FillOMapT(tOMap* m_OMap, long nObject, CDFloat* v, long nV, long* t, long nT)
{
	long idT; 
	vertex vp[3]; // vertices of triangle primitive
	int iT;

	for(idT=0;idT<nT;idT++)
	{
		for(long i=0;i<3;i++)
		{
			iT=*(t+idT*3+i);
			(vp+i)->x=*(v+3*iT);
			(vp+i)->y=*(v+3*iT+1);
			(vp+i)->z=*(v+3*iT+2);
		}
		RasterAABB(vp, 3, m_idTCell, m_nCountTCell, RASTER_SIZE);
		
		for(long i=0;i<m_nCountTCell;i++)
		{
			FillCell(m_OMap, nObject, idT, *(m_idTCell+i));
		}
	}
}