Exemplo n.º 1
0
/*!
    \fn swDesktop::_drawControl ( UNode* u )
 */
int swDesktop::_drawControl ( UNode* u )
{
    Debug;
    swUiControl* w = u->Control();
    Dbg << " drawing control : "<< w->NameID();
    Rect r = u->Geometry();
    Dbg << " Abs clipped region: " << r.tostring();
    Rect l = r;
    PStr p;
    Dbg << " Abs control position:" << w->TopLeft(true).tostring();
    l -= w->TopLeft(true); // Local area;

    Dbg << "Local area:" << l.tostring() << "<-> abs area" << r.tostring();DEND;
    swWriter* wr = w->_wr;
    for( int y = 0; y < l.height(); y ++){
        p = wr->Seek( pxy(l.topleft().x(), l.topleft().y() + y) );
        if( !p ){
            Dbg << "Seek(" << pxy(l.topleft().x(), l.topleft().y() + y).tostring() << ") : invalid: writer geometry:" << wr->Geometry().tostring(); DEND;
            return 128;
        }
        mvaddchnstr( r.topleft().y() + y, r.topleft().x(), p, l.width() );
        ///@todo get pinpoints of the current line.
        //for( int x = 0; x < l.width(); x ++){
            ///@todo check pinpoints then draw visible cells

        //}
    }
    // Check z-order dirty controls

    //::refresh();
    return 0;
}
Exemplo n.º 2
0
void CCuboid::GetGripperPositions(std::list<GripData> *list, bool just_for_endof)
{
	gp_Pnt o = m_pos.Location();
	gp_Pnt px(o.XYZ() + m_pos.XDirection().XYZ() * m_x);
	gp_Pnt py(o.XYZ() + m_pos.YDirection().XYZ() * m_y);
	gp_Dir z_dir = m_pos.XDirection() ^ m_pos.YDirection();
	gp_Pnt pz(o.XYZ() + z_dir.XYZ() * m_z);
	gp_Pnt m2(o.XYZ() + m_pos.XDirection().XYZ() * m_x + m_pos.YDirection().XYZ() * m_y/2);
	gp_Pnt m3(o.XYZ() + m_pos.XDirection().XYZ() * m_x/2 + m_pos.YDirection().XYZ() * m_y);
	gp_Pnt m8(o.XYZ() + m_pos.YDirection().XYZ() * m_y/2 + z_dir.XYZ() * m_z);
	gp_Pnt pxy(o.XYZ() + m_pos.XDirection().XYZ() * m_x + m_pos.YDirection().XYZ() * m_y);
	gp_Pnt pxz(o.XYZ() + m_pos.XDirection().XYZ() * m_x + z_dir.XYZ() * m_z);
	gp_Pnt pyz(o.XYZ() + m_pos.YDirection().XYZ() * m_y + z_dir.XYZ() * m_z);
	gp_Pnt pxyz(o.XYZ() + m_pos.XDirection().XYZ() * m_x  + m_pos.YDirection().XYZ() * m_y + z_dir.XYZ() * m_z);
	list->push_back(GripData(GripperTypeTranslate,o.X(),o.Y(),o.Z(),NULL));
	list->push_back(GripData(GripperTypeRotateObject,px.X(),px.Y(),px.Z(),NULL));
	list->push_back(GripData(GripperTypeRotateObject,py.X(),py.Y(),py.Z(),NULL));
	list->push_back(GripData(GripperTypeRotateObject,pz.X(),pz.Y(),pz.Z(),NULL));
	list->push_back(GripData(GripperTypeScale,pxyz.X(),pxyz.Y(),pxyz.Z(),NULL));
	list->push_back(GripData(GripperTypeRotate,pxy.X(),pxy.Y(),pxy.Z(),NULL));
	list->push_back(GripData(GripperTypeRotate,pxz.X(),pxz.Y(),pxz.Z(),NULL));
	list->push_back(GripData(GripperTypeRotate,pyz.X(),pyz.Y(),pyz.Z(),NULL));
	list->push_back(GripData(GripperTypeObjectScaleX,m2.X(),m2.Y(),m2.Z(),NULL));
	list->push_back(GripData(GripperTypeObjectScaleY,m3.X(),m3.Y(),m3.Z(),NULL));
	list->push_back(GripData(GripperTypeObjectScaleZ,m8.X(),m8.Y(),m8.Z(),NULL));
}
Exemplo n.º 3
0
/*!
    \fn swUiControl::SetGeometry( const Rect& r )
 */
int swUiControl::SetGeometry( const Rect& r )
{
    //swUiControl* _parent = ParentT<swUiControl>();
    swUiControl* _parent = ParentOfClass(this);
    m_geometry = r;
    pxy offset = _parent ? _parent->TopLeft(true)  : pxy(0,0);
    m_topleft = m_geometry.topleft() + offset;


    if(m_IoScrBuffer) delete [] m_IoScrBuffer;
    m_IoScrBuffer = new TCell[ Height() * Width() + Width() ];
    if( _wr ) delete _wr;
    _wr = new swWriter( this, m_IoScrBuffer, r );

    Debug << " Geometry of " << NameID() << " Set to " << m_geometry.tostring() ;DEND;
    return 0;
}