VR-Forces 4.0.4 Class Documentation
include/vrfmodel/objectSensor.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2005 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: objectSensor.h,v $ $Revision: 1.36 $ $State: Exp $
00007 *******************************************************************************/
00008 
00012 
00015 
00016 #ifndef objectSensor_H_
00017 #define objectSensor_H_
00018 
00019 #include "vrfobjcore/simCmpnt.h"
00020 #include "vrfobjcore/filteredObjList.h"
00021 #include "vrfmodel/vrfmodelDefines.h"
00022 
00023 class DtSensorContactListOutputPort;
00024 class DtObjectTypesListMultiInputPort;
00025 class DtObjectSensorDescriptor;
00026 class DtObjectSensorPSR;
00027 class DtRwSensorContactInfo;
00028 class DtObjectSensorMonitor;
00029 class DtSpatialFilterEvaluator;
00030 class DtCompositePredicate;
00031 class DtObjectType;
00032 class DtNLengthIntegerVector;
00033 class DtOrientationInputPort;
00034 class DtVectorInputPort;
00035 class DtInputPortGroup;
00036 
00050 class DT_DLL_vrfmodel DtObjectSensor : public DtSimComponent
00051 {
00052 private:
00054    DtObjectSensor();
00055 
00057    DtObjectSensor(const DtObjectSensor & 
00058       orig);
00059 
00061    const DtObjectSensor & operator=(const 
00062       DtObjectSensor & orig);
00063 
00064 public:
00065 
00068    DtObjectSensor(const DtString& name, 
00069       DtVrfObject* owner,
00070       DtSimManager* simManager, 
00071       DtComponentDescriptor* desc = 0,
00072       DtReaderWriterRegistry* parentRegistry = 0);
00073 
00075    virtual ~DtObjectSensor();
00076 
00081    virtual bool init();
00082 
00085    virtual DtString type() const;
00086 
00095    virtual void tick();
00096 
00101    virtual bool tickWhileDestroyed() const;
00102 
00106    virtual int sensorType() const;
00107 
00111    static DtSimComponent * creator(const DtString& name, 
00112       DtVrfObject* owner,
00113       DtSimManager* simManager, 
00114       DtComponentDescriptor* desc = 0,
00115       DtReaderWriterRegistry* parentRegistry = 0);
00116 
00117 protected:
00118 
00120    virtual bool createPortGroups();
00121 
00123    virtual bool createPorts();
00124 
00130    virtual DtObjectSensorPSR* createPSR();
00131 
00135    virtual const char* defaultPSRType() const;
00136 
00143    virtual void updateDetectableObjectsList();
00144 
00149 
00150 
00151    DtCompositePredicate objectTypeForcePredicate(const DtObjectType&, 
00152       const DtNLengthIntegerVector& forceTypes);
00154    DtCompositePredicate objectTypeForcePredicate(const DtObjectType&, 
00155       const std::list<DtU8>& forceTypes);
00157 
00161    virtual bool initSensorGeometry();
00162 
00166    virtual void setupGeometryForDetection();
00167 
00171    virtual DtVector localSensorPosition() const;
00172 
00176    virtual DtTaitBryan localSensorOrientation() const;
00177 
00184    virtual bool processObjects();
00185 
00194    virtual bool detectObject(DtVrfObject* object, 
00195       DtRwSensorContactInfo* contactInfo);
00196 
00207    virtual bool continueDetectingObject(DtVrfObject* object, 
00208       DtRwSensorContactInfo* contactInfo, bool& contactInfoModified);
00209 
00212    virtual bool objectWithinSensorGeometry(DtVrfObject* object) const;
00213 
00216    virtual double rangeSquaredToObject(const DtVrfObject* object) const;
00217 
00220    virtual double rangeToObject(const DtVrfObject* object) const;
00221 
00223    virtual void clearObjectRangeCache() const;
00224 
00226    virtual void printTargets() const;
00227 
00230    virtual void updateDetectedObjectListPort();
00231 
00233    virtual bool createAndInitSensorMonitor();
00234 
00236    virtual bool objectInDetectableList(DtVrfObject*) const;
00237 
00240    static void hostilitiesChangedCallback(DtU8 force, void* usr);
00241    virtual void processHostilitiesChanged(DtU8 force);
00242 
00243 protected:
00244 
00246 
00247 
00248 
00249 
00250 
00251 
00252 
00253 
00254    DtSensorContactListOutputPort * myDetectedObjectListPort;
00263    DtObjectTypesListMultiInputPort* myObjectsToDetectInputPort;
00264 
00265    
00266 
00270    DtInputPortGroup* mySensorOffsetInputPortGroup;
00271 
00278    DtOrientationInputPort* myOrientationInputPort;
00279 
00288    DtVectorInputPort* myPositionInputPort;
00289 
00291 
00292    DtManagedObjectListConstPtr myDetectableObjectList;
00293    const DtObjectSensorDescriptor* myObjectSensorDescriptor;
00294 
00297    DtObjectSensorPSR* myProcessState;
00298 
00301    DtObjectSensorMonitor* myMonitor;
00302    DtSpatialFilterEvaluator* mySensorGeometryEvaluator;
00303 
00305    mutable const DtVrfObject* myMutableObjectCached;
00307    mutable bool myMutableObjectRangeCalculated;
00309    mutable double myMutableObjectRangeCache;
00311    mutable bool myMutableObjectRangeSquaredCalculated;
00313    mutable double myMutableObjectRangeSquaredCache;
00314    
00315 };
00316 
00317 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)