source: GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp @ 974

Revision 974, 19.9 KB checked in by mattausch, 18 years ago (diff)
Line 
1// ---------------------------------------------------------------------------
2//  Includes for all the program files to see
3// ---------------------------------------------------------------------------
4#include <string.h>
5#include <stdlib.h>
6#include <iostream>
7using namespace std;
8#include <xercesc/util/PlatformUtils.hpp>
9
10// ---------------------------------------------------------------------------
11//  Includes
12// ---------------------------------------------------------------------------
13#include <xercesc/framework/StdInInputSource.hpp>
14#include <xercesc/parsers/SAXParser.hpp>
15#include <xercesc/util/OutOfMemoryException.hpp>
16
17// ---------------------------------------------------------------------------
18//  Includes
19// ---------------------------------------------------------------------------
20#include <xercesc/sax/AttributeList.hpp>
21#include <xercesc/sax/SAXParseException.hpp>
22#include <xercesc/sax/SAXException.hpp>
23
24#include "ViewCellsParser.h"
25
26#include "ViewCellsParserXerces.h"
27#include "Mesh.h"
28#include "VspBspTree.h"
29#include "ViewCellBsp.h"
30#include "VspKdTree.h"
31#include "ViewCellsManager.h"
32#include "GzFileInputSource.h"
33
34namespace GtpVisibilityPreprocessor {
35
36
37// ---------------------------------------------------------------------------
38//  Local data
39//
40//  doNamespaces
41//      Indicates whether namespace processing should be enabled or not.
42//      The default is no, but -n overrides that.
43//
44//  doSchema
45//      Indicates whether schema processing should be enabled or not.
46//      The default is no, but -s overrides that.
47//
48//  schemaFullChecking
49//      Indicates whether full schema constraint checking should be enabled or not.
50//      The default is no, but -s overrides that.
51//
52//  valScheme
53//      Indicates what validation scheme to use. It defaults to 'auto', but
54//      can be set via the -v= command.
55// ---------------------------------------------------------------------------
56static bool     doNamespaces       = false;
57static bool     doSchema           = false;
58static bool     schemaFullChecking = false;
59static SAXParser::ValSchemes    valScheme       = SAXParser::Val_Auto;
60
61
62
63
64
65// ---------------------------------------------------------------------------
66//  StdInParseHandlers: Constructors and Destructor
67// ---------------------------------------------------------------------------
68ViewCellsParseHandlers::ViewCellsParseHandlers(ObjectContainer *objects,
69                                                                                           BoundingBoxConverter *bconverter,
70                                                                                           Environment *env):
71  mElementCount(0)
72  , mAttrCount(0)
73  , mCharacterCount(0)
74  , mSpaceCount(0)
75  , mViewCellsManager(NULL)
76  , mVspBspTree(NULL)
77  , mBspTree(NULL)
78  , mViewCellsTree(NULL)
79  , mParseViewCells(true)
80  , mCurrentViewCell(NULL)
81  , mCurrentBspNode(NULL)
82  , mObjects(objects)
83  , mBoundingBoxConverter(bconverter)
84  , mEnvironment(env)
85{Debug << "here22" << endl;
86        // mObjects = objects;
87}
88
89
90ViewCellsParseHandlers::~ViewCellsParseHandlers()
91{
92}
93
94
95// ---------------------------------------------------------------------------
96//  StdInParseHandlers: Implementation of the SAX DocumentHandler interface
97// ---------------------------------------------------------------------------
98
99
100void ViewCellsParseHandlers::endElement(const XMLCh* const name)
101{
102  StrX lname(name);
103  string element(lname.LocalForm());
104
105  if (element == "ViewCells")
106          EndViewCells();
107
108  if (element == "BoundingBoxes")
109          EndBoundingBoxes();
110
111  // inside the view cell description
112  if (mParseViewCells)
113  {
114          if (element == "Interior")
115                  EndViewCellInterior();
116  }
117  else
118  {
119        if (element == "Interior")
120                  EndBspInterior();
121  }
122}
123
124
125void ViewCellsParseHandlers::EndBspInterior()
126{
127        // go one up in the tree
128        if (mCurrentBspNode->GetParent())
129        {       Debug << "öaaaaaaaaaaaa]";
130                mCurrentBspNode = mCurrentBspNode->GetParent();
131        }
132}
133
134
135void ViewCellsParseHandlers::EndViewCellInterior()
136{
137        // go one up in the tree
138        if (mCurrentViewCell->GetParent())
139        {       Debug << "]";
140                mCurrentViewCell = mCurrentViewCell->GetParent();
141        }
142}
143
144
145inline static bool vlt(ViewCell *v1, ViewCell *v2)
146{
147        return v1->mId < v2->mId;
148}
149
150
151void ViewCellsParseHandlers::EndViewCells()
152{
153        // sort view cells to help associating view cells according to their id
154        stable_sort(mViewCells.begin(), mViewCells.end(), vlt);
155}
156
157
158void ViewCellsParseHandlers::EndBoundingBoxes()
159{
160        // all bounding boxes gathered in this step =>
161        // associate object ids with bounding boxes
162        long startTime = GetTime();
163       
164        if (mBoundingBoxConverter)
165                mBoundingBoxConverter->IdentifyObjects(mIBoundingBoxes, *mObjects);
166
167        Debug << "\nconverted bounding boxes to objects in"
168                  << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl;
169}
170
171
172void ViewCellsParseHandlers::StartHierarchy(AttributeList&  attributes)
173{
174        int len = attributes.getLength();
175 
176        for (int i = 0; i < len; ++ i)
177        {
178                string attrName(StrX(attributes.getName(i)).LocalForm());
179               
180                if (attrName == "name")
181                {
182                        StrX attrValue(attributes.getValue(i));
183                       
184                        const char *ptr = attrValue.LocalForm();
185                       
186                        //-- the view cells manager is created here
187                        CreateViewCellsManager(ptr);
188                }
189        }
190}
191
192
193void ViewCellsParseHandlers::startBspElement(string element,
194                                                                                         AttributeList& attributes)
195{
196        if (element == "Interior")
197        {
198                Debug << "[";
199                StartBspInterior(attributes);
200        }
201
202        if (element == "Leaf")
203        {
204                Debug << "l";
205                StartBspLeaf(attributes);
206        }
207}
208
209
210void ViewCellsParseHandlers::startElement(const XMLCh* const name,
211                                                                                  AttributeList& attributes)
212{       Debug << "here722" << endl;
213        StrX lname(name);
214        string element(lname.LocalForm());
215
216        // decides the used view cell hierarchy
217        if (element == "ViewCells")
218        {
219                Debug << "parsing view cells" << endl;
220                mParseViewCells = true;
221        }
222
223        if (element == "Hierarchy")
224        {
225                Debug << "parsing spatial hierarchy" << endl;
226                mParseViewCells = false;
227                StartHierarchy(attributes);
228        }
229       
230        // decides the used view cell hierarchy
231        if (element == "ViewSpaceBox")
232        {
233                Debug << "v";
234                StartViewSpaceBox(attributes);
235        }
236
237        // decides the used view cell hierarchy
238        if (element == "BoundingBox")
239        {
240                Debug << "b";
241                StartBoundingBox(attributes);
242        }
243
244        // use different methods for the given view cell hierarchy types
245        if (!mParseViewCells)
246        {
247                if (mViewCellsManager)
248                {
249                        switch (mViewCellsManager->GetType())
250                        {
251                        case ViewCellsManager::BSP:
252                        case ViewCellsManager::VSP_BSP:
253                                startBspElement(element, attributes);
254                                break;
255       
256                        default:
257                                Debug << "not implemented" << endl;
258                                break;
259                        }
260                }
261        }
262        else
263        {
264                if (element == "Interior")
265                {
266                        Debug << "[";
267                        StartViewCellInterior(attributes);
268                }
269
270                if (element == "Leaf")
271                {
272                        Debug << "l";
273                        StartViewCellLeaf(attributes);
274                }
275        }
276
277        ++ mElementCount;
278        mAttrCount += attributes.getLength();
279}
280
281
282inline bool ilt(Intersectable *obj1, Intersectable *obj2)
283{
284        return obj1->mId < obj2->mId;
285}
286
287
288void ViewCellsParseHandlers::StartViewCell(ViewCell *viewCell, AttributeList&  attributes)
289{
290        int len = attributes.getLength();
291        vector<int> objIndices;
292
293        for (int i = 0; i < len; ++ i)
294        {
295                string attrName(StrX(attributes.getName(i)).LocalForm());
296               
297                if (attrName == "pvs")
298                {
299                        StrX attrValue(attributes.getValue(i));
300                       
301                        // handle coordIndex
302                        objIndices.clear();
303                        const char *ptr = attrValue.LocalForm();
304                        char *endptr;
305                       
306                        while (1)
307                        {
308                                int index = strtol(ptr, &endptr, 10);
309
310                                if (ptr == endptr)
311                                        break;
312
313                                objIndices.push_back(index);
314
315                                ptr = endptr;
316                        }
317
318                        //TODO: find objects and add them to pvs
319                        // TODO: get view cell with specified id
320                        MeshInstance dummyInst(NULL);
321
322                        vector<int>::const_iterator it, it_end = objIndices.end();
323                        for (it = objIndices.begin(); it != it_end; ++ it)
324                        {
325                                const int objId = *it; 
326                                dummyInst.SetId(objId);
327
328                                ObjectContainer::iterator oit =
329                                  lower_bound(mObjects->begin(), mObjects->end(), (Intersectable *)&dummyInst, ilt);
330                               
331                                                       
332                                if ((oit != mObjects->end()) && ((*oit)->GetId() == objId))
333                                {
334                                        // $$JB we should store a float a per object which corresponds
335                                        // to sumof pdfs, i.e. its relative visibility
336                                        // temporarily set to 1.0f
337                                        viewCell->GetPvs().AddSample(*oit, 1.0f);                               
338                                }
339                                else
340                                {
341                                        Debug << "error: object with id " << objId << " does not exist" << endl;
342                                }
343                        }
344                }
345                else if (attrName == "id")
346                {
347                        StrX attrValue(attributes.getValue(i));
348                       
349                        const char *ptr = attrValue.LocalForm();
350                        char *endptr = NULL;
351                        const int id = strtol(ptr, &endptr, 10);
352
353                        viewCell->SetId(id);
354                }
355                /*else if (attrName == "active")
356                {
357                        StrX attrValue(attributes.getValue(i));
358                       
359                        const char *ptr = attrValue.LocalForm();
360                        char *endptr = NULL;
361                        const bool isActive = (bool)strtol(ptr, &endptr, 10);
362
363                        if (isActive)
364                                viewCell->SetActive();
365                }*/
366                else if (attrName == "mergecost")
367                {
368                        StrX attrValue(attributes.getValue(i));
369                       
370                        const char *ptr = attrValue.LocalForm();
371                        char *endptr = NULL;
372                        const float cost = (float)strtod(ptr, &endptr);
373
374                        viewCell->SetMergeCost(cost);
375                }
376        }
377}
378
379
380void ViewCellsParseHandlers::StartViewSpaceBox(AttributeList& attributes)
381{
382        int len = attributes.getLength();
383
384        Vector3 bmin, bmax;
385
386        for (int i = 0; i < len; ++ i)
387        {
388                string attrName(StrX(attributes.getName(i)).LocalForm());
389                StrX attrValue(attributes.getValue(i));
390                const char *ptr = attrValue.LocalForm();
391
392                if (attrName == "min")
393                {
394                        sscanf(ptr, "%f %f %f",
395                                   &bmin.x, &bmin.y, &bmin.z);
396                }
397                else if (attrName == "max")
398                {
399                        sscanf(ptr, "%f %f %f",
400                                   &bmax.x, &bmax.y, &bmax.z);
401                }
402        }
403
404        mViewSpaceBox = AxisAlignedBox3(bmin, bmax);
405
406        Debug << "\nview space box: " << mViewSpaceBox << endl;
407}
408
409
410void ViewCellsParseHandlers::StartBoundingBox(AttributeList& attributes)
411{
412        int len = attributes.getLength();
413
414        Vector3 bmin, bmax;
415        int id;
416
417        for (int i = 0; i < len; ++ i)
418        {
419                string attrName(StrX(attributes.getName(i)).LocalForm());
420                StrX attrValue(attributes.getValue(i));
421                const char *ptr = attrValue.LocalForm();
422
423
424                if (attrName == "id")
425                {
426                        sscanf(ptr, "%d", &id);
427                }
428
429                if (attrName == "min")
430                {
431                        sscanf(ptr, "%f %f %f",
432                                   &bmin.x, &bmin.y, &bmin.z);
433                }
434                else if (attrName == "max")
435                {
436                        sscanf(ptr, "%f %f %f",
437                                   &bmax.x, &bmax.y, &bmax.z);
438                }
439        }
440
441        AxisAlignedBox3 box(bmin, bmax);
442        mIBoundingBoxes.push_back(IndexedBoundingBox(id, box));
443
444        //Debug << "bbox: " << box << endl;
445}
446
447
448void ViewCellsParseHandlers::StartBspLeaf(AttributeList& attributes)
449{
450        BspLeaf * leaf =
451                new BspLeaf(dynamic_cast<BspInterior *>(mCurrentBspNode), NULL);
452
453        if (mCurrentBspNode) // replace front or (if not NULL) back child
454        {
455                dynamic_cast<BspInterior *>(mCurrentBspNode)->ReplaceChildLink(NULL, leaf);
456        }
457        else
458        {
459                if (mViewCellsManager->GetType() == ViewCellsManager::BSP)
460                {
461                        mBspTree->mRoot = leaf;
462                }
463                else if (mViewCellsManager->GetType() == ViewCellsManager::VSP_BSP)
464                {
465                        mVspBspTree->mRoot = leaf;
466                }
467        }
468
469        //-- find associated view cell
470        int viewCellId;
471       
472        int len = attributes.getLength();
473         
474        for (int i = 0; i < len; ++ i)
475        {
476                string attrName(StrX(attributes.getName(i)).LocalForm());
477                StrX attrValue(attributes.getValue(i));
478
479                const char *ptr = attrValue.LocalForm();
480                char *endptr = NULL;
481
482                if (attrName == "viewCellId")
483                {
484                        viewCellId = strtol(ptr, &endptr, 10);
485                }
486        }
487
488       
489        if (viewCellId >= 0) // valid view cell
490        {
491                // TODO: get view cell with specified id
492                ViewCellInterior dummyVc;
493                dummyVc.SetId(viewCellId);
494
495                ViewCellContainer::iterator vit =
496                        lower_bound(mViewCells.begin(), mViewCells.end(), &dummyVc, vlt);
497                       
498                BspViewCell *viewCell = dynamic_cast<BspViewCell *>(*vit);
499
500       
501                if (viewCell->GetId() == viewCellId)
502                {
503                        leaf->SetViewCell(viewCell);
504                        viewCell->mLeaf = leaf;
505                }
506                else
507                {
508                        Debug << "error: view cell does not exist" << endl;
509                }
510        }
511        else
512        {
513                // add to invalid view space
514                if (mViewCellsManager->GetType() == ViewCellsManager::VSP_BSP)
515                {
516                        leaf->SetViewCell(mVspBspTree->GetOrCreateOutOfBoundsCell());
517                        leaf->SetTreeValid(false);
518                        mVspBspTree->PropagateUpValidity(leaf);
519                }
520        }
521}
522
523
524void ViewCellsParseHandlers::StartBspInterior(AttributeList& attributes)
525{
526        Plane3 plane;
527        int len = attributes.getLength();
528
529        for (int i = 0; i < len; ++ i)
530        {
531                string attrName(StrX(attributes.getName(i)).LocalForm());
532                StrX attrValue(attributes.getValue(i));
533                const char *ptr = attrValue.LocalForm();
534
535                if (attrName == "plane")
536                {
537                        sscanf(ptr, "%f %f %f %f",
538                                   &plane.mNormal.x, &plane.mNormal.y, &plane.mNormal.z, &plane.mD);
539                }
540        }
541
542        BspInterior* interior = new BspInterior(plane);
543       
544        if (mCurrentBspNode) // replace NULL child of parent with current node
545        {
546                BspInterior *current = dynamic_cast<BspInterior *>(mCurrentBspNode);
547
548                current->ReplaceChildLink(NULL, interior);
549                interior->SetParent(current);
550        }
551        else
552        {
553                if (mViewCellsManager->GetType() == ViewCellsManager::BSP)
554                {
555                        mBspTree->mRoot = interior;
556                }
557                else
558                {
559                        mVspBspTree->mRoot = interior;
560                }
561        }
562
563        mCurrentBspNode = interior;
564}
565
566
567void ViewCellsParseHandlers::StartViewCellLeaf(AttributeList& attributes)
568{
569        BspViewCell *viewCell = new BspViewCell();
570
571        if (mCurrentViewCell) // replace front or (if not NULL) back child
572        {
573                ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(mCurrentViewCell);
574                interior->SetupChildLink(viewCell);
575        }
576        else // root
577        {
578                mViewCellsTree->SetRoot(viewCell);
579        }
580
581        StartViewCell(viewCell, attributes);
582
583        // collect leaves
584        mViewCells.push_back(viewCell);
585}
586
587
588void ViewCellsParseHandlers::StartViewCellInterior(AttributeList& attributes)
589{
590        ViewCellInterior* interior = new ViewCellInterior();
591       
592        if (mCurrentViewCell) // replace NULL child of parent with current node
593        {
594                ViewCellInterior *current = dynamic_cast<ViewCellInterior *>(mCurrentViewCell);
595
596                current->SetupChildLink(interior);
597        }
598        else
599        {
600                mViewCellsTree->SetRoot(interior);
601        }
602
603        mCurrentViewCell = interior;
604
605        StartViewCell(interior, attributes);
606}
607
608
609
610void ViewCellsParseHandlers::CreateViewCellsManager(const char *name)
611{
612        if (strcmp(name, "bspTree") == 0)
613        {
614                Debug << "view cell type: Bsp" << endl;
615
616                mBspTree = new BspTree();
617                mBspTree->mBox = mViewSpaceBox;
618                //mCurrentBspNode = mBspTree->GetRoot();
619
620                mViewCellsManager = new BspViewCellsManager(mBspTree, mEnvironment);
621        }
622        else if (strcmp(name, "vspBspTree") == 0)
623        {
624                Debug << "view cell type: VspBsp" << endl;
625
626                mVspBspTree = new VspBspTree();
627                //mCurrentBspNode = mVspBspTree->GetRoot();
628                mViewCellsManager = new VspBspViewCellsManager(mVspBspTree, mEnvironment);
629
630                mVspBspTree->mBox = mViewSpaceBox;
631        }
632        else if (strcmp(name, "vspKdTree") == 0)
633        {
634                // TODO
635                Debug << "view cell type: VspKd" << endl;
636                mVspKdTree = new VspKdTree();   
637                mViewCellsManager = new VspKdViewCellsManager(mVspKdTree, mEnvironment);
638        }
639        else
640        {
641                cerr << "Wrong view cells type: " << name << endl;
642                exit(1);
643        }
644
645        mViewCellsTree = mViewCellsManager->GetViewCellsTree();
646        mViewCellsManager->SetViewSpaceBox(mViewSpaceBox);
647}
648
649
650void ViewCellsParseHandlers::characters(const XMLCh* const chars,
651                                                                                const unsigned int length)
652{
653        mCharacterCount += length;
654}
655
656
657void ViewCellsParseHandlers::ignorableWhitespace(const XMLCh* const chars,
658                                                                                                 const unsigned int length)
659{
660        mSpaceCount += length;
661}
662
663
664void ViewCellsParseHandlers::resetDocument()
665{
666        mAttrCount = 0;
667        mCharacterCount = 0;
668        mElementCount = 0;
669        mSpaceCount = 0;
670}
671
672
673// ---------------------------------------------------------------------------
674//  StdInParseHandlers: Overrides of the SAX ErrorHandler interface
675// ---------------------------------------------------------------------------
676void
677ViewCellsParseHandlers::error(const SAXParseException& e)
678{
679  XERCES_STD_QUALIFIER cerr << "\nError at (file " << StrX(e.getSystemId())
680                            << ", line " << e.getLineNumber()
681                            << ", char " << e.getColumnNumber()
682                            << "): " << StrX(e.getMessage()) << XERCES_STD_QUALIFIER endl;
683}
684
685void
686ViewCellsParseHandlers::fatalError(const SAXParseException& e)
687{
688  XERCES_STD_QUALIFIER cerr << "\nFatal Error at (file " << StrX(e.getSystemId())
689                            << ", line " << e.getLineNumber()
690                            << ", char " << e.getColumnNumber()
691                            << "): " << StrX(e.getMessage()) << XERCES_STD_QUALIFIER endl;
692}
693
694void
695ViewCellsParseHandlers::warning(const SAXParseException& e)
696{
697  XERCES_STD_QUALIFIER cerr << "\nWarning at (file " << StrX(e.getSystemId())
698                            << ", line " << e.getLineNumber()
699                            << ", char " << e.getColumnNumber()
700                            << "): " << StrX(e.getMessage()) << XERCES_STD_QUALIFIER endl;
701}
702
703
704bool ViewCellsParser::ParseFile(const string filename,
705                                                                ViewCellsManager **viewCells,
706                                                                ObjectContainer *objects,
707                                                                BoundingBoxConverter *bconverter,
708                                                                Environment *env)
709{
710  // Initialize the XML4C system
711  try {
712    XMLPlatformUtils::Initialize();
713  }
714 
715  catch (const XMLException& toCatch)
716    {
717      XERCES_STD_QUALIFIER cerr << "Error during initialization! Message:\n"
718                                << StrX(toCatch.getMessage()) << XERCES_STD_QUALIFIER endl;
719      return false;
720    }
721 
722  Debug << "here2" << endl;
723  //
724  //  Create a SAX parser object. Then, according to what we were told on
725  //  the command line, set the options.
726  //
727  SAXParser* parser = new SAXParser;
728  parser->setValidationScheme(valScheme);
729  parser->setDoNamespaces(doNamespaces);
730  parser->setDoSchema(doSchema);
731  parser->setValidationSchemaFullChecking(schemaFullChecking);
732 
733
734  //
735  //  Create our SAX handler object and install it on the parser, as the
736  //  document and error handler. We are responsible for cleaning them
737  //  up, but since its just stack based here, there's nothing special
738  //  to do.
739  //
740  ViewCellsParseHandlers handler(objects, bconverter, env);
741  parser->setDocumentHandler(&handler);
742  parser->setErrorHandler(&handler);
743 
744  unsigned long duration;
745  int errorCount = 0;
746  // create a faux scope so that 'src' destructor is called before
747  // XMLPlatformUtils::Terminate
748  {
749    //
750    //  Kick off the parse and catch any exceptions. Create a standard
751    //  input input source and tell the parser to parse from that.
752    //
753    //    StdInInputSource src;
754    try
755      {
756        const unsigned long startMillis = XMLPlatformUtils::getCurrentMillis();
757#if ZIPPED_VIEWCELLS
758        XMLCh *myFilePath = XMLString::transcode(filename.c_str());
759       
760        GzFileInputSource isource(myFilePath);
761        Debug << "here4" << endl;
762        parser->parse(isource);
763
764#else
765        parser->parse(filename.c_str());
766#endif
767
768        const unsigned long endMillis = XMLPlatformUtils::getCurrentMillis();
769        duration = endMillis - startMillis;
770        errorCount = parser->getErrorCount();
771      }
772    catch (const OutOfMemoryException&)
773      {
774        XERCES_STD_QUALIFIER cerr << "OutOfMemoryException" << XERCES_STD_QUALIFIER endl;
775        errorCount = 2;
776        return false;
777      }
778    catch (const XMLException& e)
779      {
780                        XERCES_STD_QUALIFIER cerr << "\nError during parsing: \n"
781                                  << StrX(e.getMessage())
782                                  << "\n" << XERCES_STD_QUALIFIER endl;
783                        errorCount = 1;
784                        return false;
785      }
786
787   
788    // Print out the stats that we collected and time taken
789    if (!errorCount) {
790                XERCES_STD_QUALIFIER cerr << filename << ": " << duration << " ms ("
791                                << handler.GetElementCount() << " elems, "
792                                << handler.GetAttrCount() << " attrs, "
793                                << handler.GetSpaceCount() << " spaces, "
794                                << handler.GetCharacterCount() << " chars)" << XERCES_STD_QUALIFIER endl;
795    }
796  }
797 
798  //
799  //  Delete the parser itself.  Must be done prior to calling Terminate, below.
800  //
801  delete parser;
802 
803  XMLPlatformUtils::Terminate();
804 
805  //-- assign new view cells manager
806  *viewCells = handler.mViewCellsManager;
807 
808  if (errorCount > 0)
809    return false;
810  else
811    return true;
812}
813
814}
Note: See TracBrowser for help on using the repository browser.