//-------------------------------------------------------------- void Surface::drawDevicePointSurface(ofRectangle& rect) { ofPushStyle(); ofSetColor(255,255,255,255); ofEnableAlphaBlending(); vector<Device*>::iterator itDevices = m_listDevices.begin(); ofVec2f posSurface; Device* pDevice=0; for (;itDevices!=m_listDevices.end();++itDevices) { pDevice = *itDevices; posSurface.set(rect.getX()+pDevice->m_pointSurface.x*rect.getWidth(), rect.getY()+pDevice->m_pointSurface.y*rect.getHeight()); if (GLOBALS->mp_deviceManager->getDeviceCurrent() == pDevice) { ofSetColor(255,255,255,255); } else ofSetColor(255,255,254,100); ofLine(posSurface.x,posSurface.y-40, posSurface.x, posSurface.y+40); ofLine(posSurface.x-40,posSurface.y, posSurface.x+40,posSurface.y); ofDrawBitmapString(pDevice->m_id, posSurface.x+4, posSurface.y-4); } ofPopStyle(); }
//-------------------------------------------------------------- void Surface::drawDevicePointSurface(ofRectangle& rect) { ofPushStyle(); ofSetColor(255,255,255,255); ofDisableAlphaBlending(); vector<Device*>::iterator itDevices = m_listDevices.begin(); ofVec2f posSurface; Device* pDevice=0; for (;itDevices!=m_listDevices.end();++itDevices) { pDevice = *itDevices; posSurface.set(rect.getX()+pDevice->m_pointSurface.x*rect.getWidth(), rect.getY()+pDevice->m_pointSurface.y*rect.getHeight()); ofLine(posSurface.x,rect.getY(), posSurface.x, rect.getY()+rect.getHeight()); ofLine(rect.getX(),posSurface.y, rect.getX()+rect.getWidth(),posSurface.y); } ofPopStyle(); }
void LaserGroup::normalize(const ofRectangle& boundingBox) { for(auto laser: m_lasers) { ofPoint pos = laser->getPosition(); pos.x = (pos.x - boundingBox.getX()) / boundingBox.getWidth(); pos.y = (pos.y - boundingBox.getY()) / boundingBox.getHeight(); pos.y = 1 - pos.y; laser->setPosition(pos); //ofLogNotice() <<"LaserGroup::normalize -> id " << getId()<< ", channel = " << getChannel() << ", x = " << laser->getPosition().x << ", y = " << laser->getPosition().y << ", z = " << laser->getPosition().z ; } }