IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4898 for trunk/psLib/src/astro


Ignore:
Timestamp:
Aug 29, 2005, 3:14:13 PM (21 years ago)
Author:
drobbin
Message:

Implemented psMemCheckType functions and tests. Some testing remains unfinished.

Location:
trunk/psLib/src/astro
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/astro/psCoord.c

    r4857 r4898  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.83 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-08-23 23:23:05 $
     12*  @version $Revision: 1.84 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-08-30 01:14:10 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    219219}
    220220
     221
     222bool psMemCheckPlane(psPtr ptr)
     223{
     224    return ( psMemGetDeallocator(ptr) == (psFreeFunc)planeFree );
     225}
     226
     227bool psMemCheckSphere(psPtr ptr)
     228{
     229    return ( psMemGetDeallocator(ptr) == (psFreeFunc)sphereFree );
     230}
     231
     232bool psMemCheckCube(psPtr ptr)
     233{
     234    return ( psMemGetDeallocator(ptr) == (psFreeFunc)cubeFree );
     235}
     236
     237bool psMemCheckPlaneTransform(psPtr ptr)
     238{
     239    return ( psMemGetDeallocator(ptr) == (psFreeFunc)planeTransformFree );
     240}
     241
    221242psPlane* psPlaneTransformApply(psPlane* out,
    222243                               const psPlaneTransform* transform,
     
    267288    return(pt);
    268289}
     290
     291bool psMemCheckPlaneDistort(psPtr ptr)
     292{
     293    return ( psMemGetDeallocator(ptr) == (psFreeFunc)planeDistortFree );
     294}
     295
     296
    269297
    270298/******************************************************************************
     
    343371    return(p);
    344372}
     373
     374bool psMemCheckProjection(psPtr ptr)
     375{
     376    return ( psMemGetDeallocator(ptr) == (psFreeFunc)projectionFree );
     377}
     378
     379
    345380
    346381psPlane* psProject(const psSphere* coord,
  • trunk/psLib/src/astro/psCoord.h

    r4877 r4898  
    1010*  @author GLG, MHPCC
    1111*
    12 *  @version $Revision: 1.41 $ $Name: not supported by cvs2svn $
    13 *  @date $Date: 2005-08-25 23:42:01 $
     12*  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
     13*  @date $Date: 2005-08-30 01:14:10 $
    1414*
    1515*  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    219219);
    220220
     221/** Checks the type of a particular pointer.
     222 *
     223 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     224 *
     225 *  @return bool:       True if the pointer matches a psPlane structure, false otherwise.
     226 */
     227bool psMemCheckPlane(
     228    psPtr ptr                          ///< the pointer whose type to check
     229);
     230
     231/** Checks the type of a particular pointer.
     232 *
     233 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     234 *
     235 *  @return bool:       True if the pointer matches a psSphere structure, false otherwise.
     236 */
     237bool psMemCheckSphere(
     238    psPtr ptr                          ///< the pointer whose type to check
     239);
     240
     241/** Checks the type of a particular pointer.
     242 *
     243 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     244 *
     245 *  @return bool:       True if the pointer matches a psCube structure, false otherwise.
     246 */
     247bool psMemCheckCube(
     248    psPtr ptr                          ///< the pointer whose type to check
     249);
     250
     251/** Checks the type of a particular pointer.
     252 *
     253 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     254 *
     255 *  @return bool:       True if the pointer matches a psPlaneTransform structure, false otherwise.
     256 */
     257bool psMemCheckPlaneTransform(
     258    psPtr ptr                          ///< the pointer whose type to check
     259);
     260
     261/** Checks the type of a particular pointer.
     262 *
     263 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     264 *
     265 *  @return bool:       True if the pointer matches a psPlaneDistort structure, false otherwise.
     266 */
     267bool psMemCheckPlaneDistort(
     268    psPtr ptr                          ///< the pointer whose type to check
     269);
     270
     271/** Checks the type of a particular pointer.
     272 *
     273 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     274 *
     275 *  @return bool:       True if the pointer matches a psProjection structure, false otherwise.
     276 */
     277bool psMemCheckProjection(
     278    psPtr ptr                          ///< the pointer whose type to check
     279);
     280
     281
    221282/** Projects a spherical coordinate to a linear coordinate system
    222283 *
  • trunk/psLib/src/astro/psSphereOps.c

    r4708 r4898  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-08-05 01:40:45 $
     9 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-08-30 01:14:10 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    3333#define JULIAN_CENTURY 36525.0
    3434
     35static void sphereRotFree(psSphereRot *result)
     36{
     37    // There are non dynamic allocated items
     38}
    3539
    3640psSphereRot* psSphereRotAlloc(double alphaP,
     
    5862    // calculate t*s*r.
    5963    psSphereRot* result = psSphereRotCombine(NULL,&t,&s);
     64    psMemSetDeallocator(result, (psFreeFunc)sphereRotFree);
    6065    psSphereRotCombine(result,result,&r);
    6166
    6267    return result;
    6368}
     69
     70bool psMemCheckSphereRot(psPtr ptr)
     71{
     72    return ( psMemGetDeallocator(ptr) == (psFreeFunc)sphereRotFree );
     73}
     74
    6475
    6576psSphereRot* psSphereRotQuat(double q0,
  • trunk/psLib/src/astro/psSphereOps.h

    r4708 r4898  
    77 *  @author Robert DeSonia, MHPCC
    88 *
    9  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    10  *  @date $Date: 2005-08-05 01:40:45 $
     9 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     10 *  @date $Date: 2005-08-30 01:14:10 $
    1111 *
    1212 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    7272);
    7373
     74
     75/** Checks the type of a particular pointer.
     76 *
     77 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     78 *
     79 *  @return bool:       True if the pointer matches a psSphereRot structure, false otherwise.
     80 */
     81bool psMemCheckSphereRot(
     82    psPtr ptr                          ///< the pointer whose type to check
     83);
     84
     85
    7486/** Allocator for psSphereRot given quaternions.
    7587 *
  • trunk/psLib/src/astro/psTime.c

    r4540 r4898  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2005-07-12 19:12:00 $
     12 *  @version $Revision: 1.67 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2005-08-30 01:14:10 $
    1414 *
    1515 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    434434}
    435435
     436static void timeFree(psTime *outTime)
     437{
     438    // There are non dynamic allocated items
     439}
     440
    436441psTime* psTimeAlloc(psTimeType type)
    437442{
     
    449454    // Allocate memory for structure
    450455    outTime = (psTime*)psAlloc(sizeof(psTime));
    451 
     456    psMemSetDeallocator(outTime, (psFreeFunc)timeFree);
    452457    // Initialize members
    453458    outTime->sec = 0;
     
    458463    return outTime;
    459464}
     465
     466
     467bool psMemCheckTime(psPtr ptr)
     468{
     469    return ( psMemGetDeallocator(ptr) == (psFreeFunc)timeFree );
     470}
     471
    460472
    461473psTime* psTimeGetNow(psTimeType type)
  • trunk/psLib/src/astro/psTime.h

    r4590 r4898  
    1111 *  @author Ross Harman, MHPCC
    1212 *
    13  *  @version $Revision: 1.34 $ $Name: not supported by cvs2svn $
    14  *  @date $Date: 2005-07-21 02:39:57 $
     13 *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
     14 *  @date $Date: 2005-08-30 01:14:10 $
    1515 *
    1616 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
     
    100100);
    101101
     102
     103/** Checks the type of a particular pointer.
     104 *
     105 *  Uses the appropriate deallocation function in psMemBlock to check the ptr datatype.
     106 *
     107 *  @return bool:       True if the pointer matches a psTime structure, false otherwise.
     108 */
     109bool psMemCheckTime(
     110    psPtr ptr                          ///< the pointer whose type to check
     111);
     112
     113
    102114/** Get current time.
    103115 *
Note: See TracChangeset for help on using the changeset viewer.