Skip to content

Commit

Permalink
Dual port TUIO sending done ! Removed GPU support temporarily as it i…
Browse files Browse the repository at this point in the history
…s not used and it eats up memory :-/ !

git-svn-id: http://ccv-tt.googlecode.com/svn/trunk@106 85fc5e24-5cb5-a459-a2e3-60d0933772b6
  • Loading branch information
amit.getinfo committed Oct 20, 2010
1 parent 4760ecc commit fe7863d
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 28 deletions.
6 changes: 4 additions & 2 deletions CCV-COT/addons/ofxNCore/src/Communication/TUIO.cpp
Expand Up @@ -209,7 +209,8 @@ void TUIO::sendTUIO(std::map<int, Blob> * fingerBlobs, std::map<int, Blob> * obj
}
}
}
else if(bTCPMode) // else, if TCP (flash) mode

if(bTCPMode) // else, if TCP (flash) mode
{
if(bFingers || bObjects)
{
Expand Down Expand Up @@ -358,7 +359,8 @@ void TUIO::sendTUIO(std::map<int, Blob> * fingerBlobs, std::map<int, Blob> * obj
}
}
}
else if(bBinaryMode) // else, if TCP (binary) mode

if(bBinaryMode) // else, if TCP (binary) mode
{
if(bFingers)
{
Expand Down
20 changes: 10 additions & 10 deletions CCV-COT/addons/ofxNCore/src/Controls/gui.h
Expand Up @@ -422,24 +422,24 @@ void ofxNCoreVision ::handleGui(int parameterId, int task, void* data, int lengt
case optionPanel_tuio_osc:
if(length == sizeof(bool))
myTUIO.bOSCMode = *(bool*)data;
bTUIOMode = *(bool*)data;
// bTUIOMode = *(bool*)data;
//set tcp to opposite
myTUIO.bTCPMode = false;
controls->update(appPtr->optionPanel_tuio_tcp, kofxGui_Set_Bool, &appPtr->myTUIO.bTCPMode, sizeof(bool));
myTUIO.bBinaryMode = false;
controls->update(appPtr->optionPanel_bin_tcp, kofxGui_Set_Bool, &appPtr->myTUIO.bBinaryMode, sizeof(bool));
// myTUIO.bTCPMode = false;
// controls->update(appPtr->optionPanel_tuio_tcp, kofxGui_Set_Bool, &appPtr->myTUIO.bTCPMode, sizeof(bool));
// myTUIO.bBinaryMode = false;
// controls->update(appPtr->optionPanel_bin_tcp, kofxGui_Set_Bool, &appPtr->myTUIO.bBinaryMode, sizeof(bool));
//clear blobs
// myTUIO.blobs.clear();
break;
case optionPanel_tuio_tcp:
if(length == sizeof(bool))
myTUIO.bTCPMode = *(bool*)data;
bTUIOMode = *(bool*)data;
// bTUIOMode = *(bool*)data;
//set osc to opposite
myTUIO.bOSCMode = false;
controls->update(appPtr->optionPanel_tuio_osc, kofxGui_Set_Bool, &appPtr->myTUIO.bOSCMode, sizeof(bool));
myTUIO.bBinaryMode = false;
controls->update(appPtr->optionPanel_bin_tcp, kofxGui_Set_Bool, &appPtr->myTUIO.bBinaryMode, sizeof(bool));
// myTUIO.bOSCMode = false;
// controls->update(appPtr->optionPanel_tuio_osc, kofxGui_Set_Bool, &appPtr->myTUIO.bOSCMode, sizeof(bool));
// myTUIO.bBinaryMode = false;
// controls->update(appPtr->optionPanel_bin_tcp, kofxGui_Set_Bool, &appPtr->myTUIO.bBinaryMode, sizeof(bool));
//clear blobs
// myTUIO.blobs.clear();
break;
Expand Down
2 changes: 1 addition & 1 deletion CCV-COT/addons/ofxNCore/src/Filters/GPUImageFilter.cpp
Expand Up @@ -12,7 +12,7 @@
#include "tinyxml.h"
#include "ofUtils.h"

#pragma warning(disable : 4244) // 'conversion' conversion from 'type1' to 'type2' possible loss of data
#pragma warning(disable : 4244) // 'conversion' conversion from 'type1' to 'type2' possible loss of data

//helper functon, should go somewhere else
void getFrameBufferForTexture(GLuint* fbo, GLuint* tex, int sizeX, int sizeY){
Expand Down
3 changes: 2 additions & 1 deletion CCV-COT/addons/ofxNCore/src/Filters/ProcessFilters.h
Expand Up @@ -38,7 +38,8 @@ class ProcessFilters : public Filters {
//GPU Setup
gpuReadBackBuffer = new unsigned char[camWidth*camHeight*3];
gpuReadBackImageGS.allocate(camWidth, camHeight);
allocateGPU();
//allocateGPU();
//^^ Commented out for now, till full GPU implementation
}

void allocateGPU(){
Expand Down
24 changes: 15 additions & 9 deletions CCV-COT/addons/ofxNCore/src/Modules/ofxNCoreVision.cpp
Expand Up @@ -479,8 +479,9 @@ void ofxNCoreVision::_update(ofEventArgs &e)
}//End Background Learning rate

//Sending TUIO messages
if (bTUIOMode)
if (myTUIO.bOSCMode || myTUIO.bTCPMode || myTUIO.bBinaryMode)
{
//printf("sending data osc : %d TCP : %d binary : %d\n", myTUIO.bOSCMode, myTUIO.bTCPMode, myTUIO.bBinaryMode);
myTUIO.setMode(contourFinder.bTrackFingers , contourFinder.bTrackObjects, contourFinder.bTrackFiducials);
myTUIO.sendTUIO(&getBlobs(),&getObjects(),&fidfinder.fiducialsList);
}
Expand Down Expand Up @@ -727,12 +728,17 @@ void ofxNCoreVision::drawFullMode()
verdana.drawString(str3+ str1 + str6 + str4 + str2 + str5 , 573, 427);
}

if (bTUIOMode)
{

char buf[256];
if(myTUIO.bOSCMode)

//TUIO data drawing
char buf[256]="";
if(myTUIO.bOSCMode && myTUIO.bTCPMode)
{
sprintf(buf, "Dual Mode");
}
else if(myTUIO.bOSCMode)
{
sprintf(buf, "Host: %s\nProtocol: UDP [OSC]\nPort: %i", myTUIO.localHost, myTUIO.TUIOPort);
}
else if(myTUIO.bTCPMode)
{
if(myTUIO.bIsConnected)
Expand All @@ -750,7 +756,7 @@ void ofxNCoreVision::drawFullMode()

ofSetColor(0x969696);
verdana.drawString(buf, 573, 515);
}

}

void ofxNCoreVision::drawMiniMode()
Expand Down Expand Up @@ -939,8 +945,8 @@ void ofxNCoreVision::_keyPressed(ofKeyEventArgs &e)
// myTUIO.blobs.clear();
break;
case 'g':
bGPUMode ? bGPUMode = false : bGPUMode = true;
filter->bLearnBakground = true;
// bGPUMode ? bGPUMode = false : bGPUMode = true;
// filter->bLearnBakground = true;
break;
case 'v':
if (bcamera && vidGrabber != NULL)
Expand Down
10 changes: 5 additions & 5 deletions CCV-COT/apps/addonsExamples/VS2008/bin/data/config.xml
Expand Up @@ -42,11 +42,11 @@
<HEIGHT>600</HEIGHT>
</WINDOW>
<BOOLEAN>
<PRESSURE>13</PRESSURE>
<PRESSURE>205</PRESSURE>
<LABELS>1</LABELS>
<OUTLINES>0</OUTLINES>
<LEARNBG>0</LEARNBG>
<TUIO>1</TUIO>
<TUIO>0</TUIO>
<VMIRROR>0</VMIRROR>
<HMIRROR>0</HMIRROR>
<HIGHPASS>0</HIGHPASS>
Expand All @@ -57,21 +57,21 @@
<SNAPSHOT>0</SNAPSHOT>
<MINIMODE>0</MINIMODE>
<HEIGHTWIDTH>0</HEIGHTWIDTH>
<OSCMODE>1</OSCMODE>
<OSCMODE>0</OSCMODE>
<TCPMODE>0</TCPMODE>
<BINMODE>0</BINMODE>
<TRACKDARK>0</TRACKDARK>
<TRACKFINGERS>0</TRACKFINGERS>
<TRACKOBJECTS>0</TRACKOBJECTS>
<TRACKFIDUCIALS>1</TRACKFIDUCIALS>
<TRACKFIDUCIALS>0</TRACKFIDUCIALS>
<UNDISTORT>0</UNDISTORT>
</BOOLEAN>
<INT>
<MINMOVEMENT>0</MINMOVEMENT>
<MINBLOBSIZE>25</MINBLOBSIZE>
<MAXBLOBSIZE>100</MAXBLOBSIZE>
<BGLEARNRATE>0.010000</BGLEARNRATE>
<THRESHOLD>85</THRESHOLD>
<THRESHOLD>21</THRESHOLD>
<HIGHPASSBLUR>10</HIGHPASSBLUR>
<HIGHPASSNOISE>1</HIGHPASSNOISE>
<HIGHPASSAMP>8</HIGHPASSAMP>
Expand Down

0 comments on commit fe7863d

Please sign in to comment.