Horus Doc || Corba Reference || Corba   Client Server   Stubs C++   Stubs Java   Servant Generator  

HxGlobalOpsServant Class Reference

(Part of) the servant for the GlobalOps interface. More...

#include <HxGlobalOpsServant.h>

Inheritance diagram for HxGlobalOpsServant::

HxGlobalOpsGenSvt HxUserOpsServant POA_HxCorba::GlobalOps HxUserOpsGenSvt POA_HxCorba::UserOps POA_HxCorba::UserOps List of all members.

Public Methods

 HxGlobalOpsServant (HxServerBase *)
virtual ~HxGlobalOpsServant ()
void HxExportMatlabPixels (HxCorba::ImageRep_ptr im, HxCorba::DoubleSeq &pixels) throw (CORBA::SystemException)
HxCorba::Blob2dSetHxLabelBlobs (HxCorba::ImageRep_ptr image, HxCorba::ImageRep_ptr mask, CORBA::Long minimalBlobArea) throw (CORBA::SystemException)
HxCorba::DoubleSeqSeqHxNJetInvar (HxCorba::ImageRep_ptr im, const char *invar, CORBA::Double scale, CORBA::Long nBin) throw (CORBA::SystemException)
HxCorba::FloatSeqHxInvarGetHistos (const char *invar, const char *key) throw (CORBA::SystemException)
HxCorba::DoubleSeqHxInvarScores (const char *invar, CORBA::Long n) throw (CORBA::SystemException)

Protected Attributes

HxServerBase_server

Detailed Description

(Part of) the servant for the GlobalOps interface.

The constituent parts of the servant are: HxUserOpsGenSvt, HxUserOpsServant, HxGlobalOpsGenSvt, and HxGlobalOpsServant.


Constructor & Destructor Documentation

HxGlobalOpsServant::HxGlobalOpsServant HxServerBase   s
 

00017     : HxUserOpsServant(s), HxGlobalOpsGenSvt(s), HxUserOpsGenSvt(s), 
00018       _server(s)
00019 {
00020 }

HxGlobalOpsServant::~HxGlobalOpsServant   [virtual]
 

00023 {
00024 }


Member Function Documentation

void HxGlobalOpsServant::HxExportMatlabPixels HxCorba::ImageRep_ptr    image,
HxCorba::DoubleSeq   pixels
throw (CORBA::SystemException)
 

00031 {
00032     HxImageRep img = HxGetTiedObject<HxImageRepTiedSvt>(_server, image);
00033     double* pix = (double*)pixels.get_buffer();
00034 
00035     ::HxExportMatlabPixels(img, pix);
00036 }

HxCorba::Blob2dSet * HxGlobalOpsServant::HxLabelBlobs HxCorba::ImageRep_ptr    image,
HxCorba::ImageRep_ptr    mask,
CORBA::Long    minimalBlobArea
throw (CORBA::SystemException)
 

00045 {
00046     HxImageRep img = HxGetTiedObject<HxImageRepTiedSvt>(_server,image);
00047     HxImageRep imgMask = HxGetTiedObject<HxImageRepTiedSvt>(_server,mask);
00048 
00049     HxString blobs = ::HxLabelBlobs(img, imgMask, minimalBlobArea);
00050 
00051     HxCorba::Blob2dSet_var blobseq = new HxCorba::Blob2dSet();
00052     int seqlength = 0;
00053     HxString name = "";
00054     for(int i=0; i<blobs.length(); i++)
00055     {
00056         if(blobs[i] == ' ') {
00057             HxBlob2d* blob = HxBlob2dRepository::instance().find(name);
00058             HxCorba::Blob2d_ptr objBlob =
00059                 HxRegisterTiedServant<HxBlob2dTiedSvt>(_server, *blob);
00060             blobseq->length(seqlength+1);
00061             blobseq[seqlength++] = objBlob;
00062             name = "";
00063         }
00064         else
00065             name += blobs[i];
00066     }
00067 
00068     return blobseq._retn();
00069 }

HxCorba::DoubleSeqSeq * HxGlobalOpsServant::HxNJetInvar HxCorba::ImageRep_ptr    im,
const char *    invar,
CORBA::Double    scale,
CORBA::Long    nBin
throw (CORBA::SystemException)
 

00077 {
00078     HxImageRep hxIm = HxGetTiedObject<HxImageRepTiedSvt>(_server,im);
00079 
00080     HxHistoList hxList = ::HxNJetInvar(hxIm, invar, scale, nBin);
00081 
00082     HxCorba::DoubleSeqSeq_var theSeq = new HxCorba::DoubleSeqSeq();
00083     theSeq->length(hxList.size());
00084     int i=0;
00085     for(HxHistoList::iterator it = hxList.begin() ; it != hxList.end() ; it++) {
00086         HxHistogram hxHist = *it;
00087         int n = hxHist.dimensionSize(1);
00088         HxCorba::DoubleSeq_var s = new HxCorba::DoubleSeq();
00089         s->length(n);
00090         for (int j=0 ; j<n ; j++)
00091             s[j] = hxHist.get(j);
00092         theSeq[i++] = s;
00093     }
00094 
00095     return theSeq._retn();
00096 }

HxCorba::FloatSeq * HxGlobalOpsServant::HxInvarGetHistos const char *    invar,
const char *    key
throw (CORBA::SystemException)
 

00105 {
00106     float* data = ::HxInvarGetHistos(invar, key);
00107     int length = ::HxInvarBinsPerHistogram(invar)*::HxInvarChannels(invar);
00108     if(!data) length = 0;
00109 
00110     HxCorba::FloatSeq_var seq = new HxCorba::FloatSeq(length, length, data);
00111 
00112     return seq._retn();
00113 }

HxCorba::DoubleSeq * HxGlobalOpsServant::HxInvarScores const char *    invar,
CORBA::Long    n
throw (CORBA::SystemException)
 

00120 {
00121     double* scores = ::HxInvarScores(invar, n);
00122 
00123     HxCorba::DoubleSeq_var seq = new HxCorba::DoubleSeq(n, n, scores, true);
00124 
00125     return seq._retn();
00126 }


Member Data Documentation

HxServerBase* HxGlobalOpsServant::_server [protected]
 

Reimplemented from HxGlobalOpsGenSvt.


The documentation for this class was generated from the following files:
Generated on Tue Feb 3 14:20:16 2004 for CorbaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001