Revision 68
| branches/test/CCV_Select_Camera/addons/ofxNCore/src/Controls/ofxGuiGrid.h (revision 68) | ||
|---|---|---|
| 40 | 40 |
void setOffset( int offset ); |
| 41 | 41 |
void setMode( int mode, bool value = true ); |
| 42 | 42 |
void setDraggingRawIndex( int index ); |
| 43 |
void resetAll(); |
|
| 43 | 44 |
|
| 44 | 45 |
bool next(); |
| 45 | 46 |
bool previous(); |
| branches/test/CCV_Select_Camera/addons/ofxNCore/src/Controls/ofxGuiGrid.cpp (revision 68) | ||
|---|---|---|
| 131 | 131 |
|
| 132 | 132 |
// ---------------------------------------------- |
| 133 | 133 |
|
| 134 |
void ofxGuiGrid::resetAll() {
|
|
| 135 |
if ( mDisplayMode == kofxGui_Grid_Display ) {
|
|
| 136 |
this->setXY( mXGrid, mYGrid ); |
|
| 137 |
} |
|
| 138 |
} |
|
| 139 |
|
|
| 140 |
// ---------------------------------------------- |
|
| 141 |
|
|
| 134 | 142 |
bool ofxGuiGrid::next() {
|
| 135 | 143 |
if ( mDisplayMode == kofxGui_Grid_List ) {
|
| 136 | 144 |
if ( mXGrid * mYGrid + mIndexOffset + 1 <= utils->getCount() ) {
|
| branches/test/CCV_Select_Camera/addons/ofxNCore/src/MultiCams/MultiCams.cpp (revision 68) | ||
|---|---|---|
| 293 | 293 |
break; |
| 294 | 294 |
//////////////////////////////////////// |
| 295 | 295 |
// STEP 3 |
| 296 |
//! Reset All |
|
| 297 |
case step3Panel_reset_all: |
|
| 298 |
if ( length == sizeof( bool ) ) {
|
|
| 299 |
if ( *(bool*)data ) {
|
|
| 300 |
if ( utils != NULL ) {
|
|
| 301 |
utils->resetAll(); |
|
| 302 |
} |
|
| 303 |
//! Refresh the images |
|
| 304 |
if ( camsGrid != NULL ) {
|
|
| 305 |
camsGrid->resetAll(); |
|
| 306 |
} |
|
| 307 |
} |
|
| 308 |
} |
|
| 309 |
break; |
|
| 296 | 310 |
//! Previous step |
| 297 | 311 |
case step3Panel_previous: |
| 298 | 312 |
if ( length == sizeof( bool ) ) {
|
| ... | ... | |
| 558 | 572 |
//pPanel->addMatrix( this->step3Panel_matrix, "Thumbnails", |
| 559 | 573 |
// GENERAL_AREA_MATRIX_WIDTH, GENERAL_AREA_MATRIX_HEIGHT, |
| 560 | 574 |
// XAxis, YAxis, kofxGui_Matrix_Clear, kofxGui_Button_Trigger, OFXGUI_MATRIX_SPACING ); |
| 575 |
pPanel->addButton( this->step3Panel_reset_all, "Reset All", |
|
| 576 |
OFXGUI_BUTTON_HEIGHT, OFXGUI_BUTTON_HEIGHT, |
|
| 577 |
kofxGui_Button_Off, kofxGui_Button_Trigger ); |
|
| 561 | 578 |
pPanel->addButton( this->step3Panel_previous,"Previous", |
| 562 | 579 |
OFXGUI_BUTTON_HEIGHT, OFXGUI_BUTTON_HEIGHT, |
| 563 | 580 |
kofxGui_Button_Off, kofxGui_Button_Trigger ); |
| ... | ... | |
| 569 | 586 |
|
| 570 | 587 |
//pPanel->mObjects[1]->mObjX = 10; //! [1]: Matrix |
| 571 | 588 |
//pPanel->mObjects[1]->mObjY = 45; |
| 572 |
//pPanel->mObjects[2]->mObjX = GENERAL_AREA_PREV_X; //! [2]: Previous |
|
| 573 |
//pPanel->mObjects[2]->mObjY = GENERAL_AREA_PREV_Y; |
|
| 574 |
//pPanel->mObjects[3]->mObjX = GENERAL_AREA_NEXT_X; //! [3]: Next |
|
| 575 |
//pPanel->mObjects[3]->mObjY = GENERAL_AREA_NEXT_Y; |
|
| 576 |
pPanel->mObjects[1]->mObjX = GENERAL_AREA_PREV_X; //! [2]: Previous |
|
| 577 |
pPanel->mObjects[1]->mObjY = GENERAL_AREA_PREV_Y; |
|
| 578 |
pPanel->mObjects[2]->mObjX = GENERAL_AREA_NEXT_X; //! [3]: Next |
|
| 579 |
pPanel->mObjects[2]->mObjY = GENERAL_AREA_NEXT_Y; |
|
| 589 |
pPanel->mObjects[2]->mObjX = GENERAL_AREA_PREV_X; //! [2]: Previous |
|
| 590 |
pPanel->mObjects[2]->mObjY = GENERAL_AREA_PREV_Y; |
|
| 591 |
pPanel->mObjects[3]->mObjX = GENERAL_AREA_NEXT_X; //! [3]: Next |
|
| 592 |
pPanel->mObjects[3]->mObjY = GENERAL_AREA_NEXT_Y; |
|
| 580 | 593 |
|
| 594 |
//pPanel->mObjects[1]->mObjX = GENERAL_AREA_PREV_X; //! [1]: Previous |
|
| 595 |
//pPanel->mObjects[1]->mObjY = GENERAL_AREA_PREV_Y; |
|
| 596 |
//pPanel->mObjects[2]->mObjX = GENERAL_AREA_NEXT_X; //! [2]: Next |
|
| 597 |
//pPanel->mObjects[2]->mObjY = GENERAL_AREA_NEXT_Y; |
|
| 598 |
|
|
| 581 | 599 |
pPanel->adjustToNewContent( 140, 0 ); |
| 582 | 600 |
|
| 583 | 601 |
break; |
| branches/test/CCV_Select_Camera/addons/ofxNCore/src/MultiCams/MultiCams.h (revision 68) | ||
|---|---|---|
| 71 | 71 |
step3Panel, |
| 72 | 72 |
step3Panel_tip, |
| 73 | 73 |
step3Panel_matrix, |
| 74 |
step3Panel_reset_all, |
|
| 74 | 75 |
step3Panel_previous, |
| 75 | 76 |
step3Panel_next, |
| 76 | 77 |
|
| branches/test/CCV_Select_Camera/addons/ofxNCore/src/MultiCams/CamsUtils.cpp (revision 68) | ||
|---|---|---|
| 196 | 196 |
|
| 197 | 197 |
// ---------------------------------------------- |
| 198 | 198 |
|
| 199 |
void CamsUtils::resetAll() {
|
|
| 200 |
//! Set X/Y as reset all |
|
| 201 |
setXY( xGrid, yGrid ); |
|
| 202 |
|
|
| 203 |
//! Clean up selected cams |
|
| 204 |
for ( int i = 0; i < xGrid * yGrid; ++i ) {
|
|
| 205 |
camsSelected[i] = false; |
|
| 206 |
} |
|
| 207 |
} |
|
| 208 |
|
|
| 209 |
// ---------------------------------------------- |
|
| 210 |
|
|
| 211 |
void CamsUtils::saveXML( string filename ) {
|
|
| 212 |
// TODO |
|
| 213 |
} |
|
| 214 |
|
|
| 215 |
// ---------------------------------------------- |
|
| 216 |
|
|
| 199 | 217 |
int CamsUtils::getDevicesCount() {
|
| 200 | 218 |
return CLEyeGetCameraCount(); |
| 201 | 219 |
} |
| branches/test/CCV_Select_Camera/addons/ofxNCore/src/MultiCams/CamsUtils.h (revision 68) | ||
|---|---|---|
| 14 | 14 |
// ---------------------------------------------- |
| 15 | 15 |
|
| 16 | 16 |
#include "PS3.h" |
| 17 |
#include "ofxXmlSettings.h" |
|
| 17 | 18 |
|
| 18 | 19 |
// ---------------------------------------------- |
| 19 | 20 |
|
| ... | ... | |
| 45 | 46 |
void setXY( int x, int y ); |
| 46 | 47 |
void setCam( int index, PS3* cam ); |
| 47 | 48 |
void setCam( int x, int y, PS3* cam ); |
| 49 |
void resetAll(); |
|
| 48 | 50 |
|
| 51 |
//! Save the settings to XML file |
|
| 52 |
void saveXML( string filename = "" ); |
|
| 53 |
|
|
| 49 | 54 |
int camCount, selectedCamCount; |
| 50 | 55 |
int xGrid, yGrid; |
| 51 | 56 |
PS3** rawCams; |
| ... | ... | |
| 61 | 66 |
CLEyeCameraColorMode colorMode; |
| 62 | 67 |
CLEyeCameraResolution camRes; |
| 63 | 68 |
float frameRate; |
| 69 |
ofxXmlSettings XML; |
|
| 64 | 70 |
}; |
| 65 | 71 |
|
| 66 | 72 |
// ---------------------------------------------- |
Also available in: Unified diff
