Index: trunk/psModules/src/objects/pmSource.h
===================================================================
--- trunk/psModules/src/objects/pmSource.h	(revision 11253)
+++ trunk/psModules/src/objects/pmSource.h	(revision 13034)
@@ -3,6 +3,6 @@
  * @author EAM, IfA; GLG, MHPCC
  *
- * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- * @date $Date: 2007-01-24 02:54:15 $
+ * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2007-04-26 01:20:29 $
  * Copyright 2004 Maui High Performance Computing Center, University of Hawaii
  */
@@ -13,21 +13,4 @@
 /// @addtogroup Objects Object Detection / Analysis Functions
 /// @{
-
-/**
- * In the object analysis process, we will use specific mask values to mark the
- * image pixels. The following structure defines the relevant mask values.
- *
- * XXX: This is probably a bad solution: we will want to set mask values
- * outside of the PSPHOT code.  Perhaps we can set up a registered set of mask
- * values with specific meanings that other functions can add to or define?
- 
- * XXX We will only use the PM_MASK_xxx mask values
-typedef enum {
-    PM_SOURCE_MASK_CLEAR     = 0x00,
-    PM_SOURCE_MASK_INVALID   = 0x01,
-    PM_SOURCE_MASK_SATURATED = 0x02,
-    PM_SOURCE_MASK_MARKED    = 0x08,
-} psphotMaskValues;
-*/
 
 /** pmSourceType enumeration
@@ -75,22 +58,24 @@
 typedef struct
 {
-    const int id;   ///< Unique ID for object
-    pmPeak *peak;   ///< Description of peak pixel.
-    psImage *pixels;   ///< Rectangular region including object pixels.
-    psImage *weight;   ///< Image variance.
-    psImage *mask;   ///< Mask which marks pixels associated with objects.
-    pmMoments *moments;   ///< Basic moments measure for the object.
-    pmModel *modelPSF;   ///< PSF Model fit (parameters and type)
-    pmModel *modelEXT;   ///< EXT (floating) Model fit (parameters and type).
-    pmSourceType type;   ///< Best identification of object.
-    pmSourceMode mode;   ///< Best identification of object.
+    const int id;			///< Unique ID for object
+    pmPeak *peak;			///< Description of peak pixel.
+    psImage *pixels;			///< Rectangular region including object pixels.
+    psImage *weight;			///< Image variance.
+    psImage *modelFlux;			///< cached copy of the model for this source
+    psImage *maskObj;			///< unique mask for this object which marks included pixels associated with objects.
+    psImage *maskView;			///< view into global image mask for this object region
+    pmMoments *moments;			///< Basic moments measure for the object.
+    pmModel *modelPSF;			///< PSF Model fit (parameters and type)
+    pmModel *modelEXT;			///< EXT (floating) Model fit (parameters and type).
+    pmSourceType type;			///< Best identification of object.
+    pmSourceMode mode;			///< Best identification of object.
     psArray *blends;
-    float psfMag;   ///< calculated from flux in modelPsf
-    float extMag;   ///< calculated from flux in modelEXT
-    float errMag;   ///< error in psfMag OR extMag (depending on type)
-    float apMag;   ///< apMag corresponding to psfMag or extMag (depending on type)
-    float pixWeight;   // model-weighted coverage of valid pixels
-    psRegion region;   // area on image covered by selected pixels
-    float sky, skyErr;   //?< The sky and its error at the center of the object
+    float psfMag;			///< calculated from flux in modelPsf
+    float extMag;			///< calculated from flux in modelEXT
+    float errMag;			///< error in psfMag OR extMag (depending on type)
+    float apMag;	       ///< apMag corresponding to psfMag or extMag (depending on type)
+    float pixWeight;			// model-weighted coverage of valid pixels
+    psRegion region;			// area on image covered by selected pixels
+    float sky, skyErr;			//?< The sky and its error at the center of the object
 }
 pmSource;
@@ -225,7 +210,11 @@
 );
 
-
-// select the model used for this source
-pmModel *pmSourceSelectModel (pmSource *source);
+pmModel *pmSourceGetModel (bool *isPSF, const pmSource *source);
+
+bool pmSourceAdd (pmSource *source, pmModelOpMode mode);
+bool pmSourceSub (pmSource *source, pmModelOpMode mode);
+
+bool pmSourceOp (pmSource *source, pmModelOpMode mode, bool add);
+bool pmSourceCacheModel (pmSource *source);
 
 /// @}
