00001 /*---------------------------------------------------------------------------*\ 00002 * OpenSG * 00003 * * 00004 * * 00005 * Copyright (C) 2000-2002 by the OpenSG Forum * 00006 * * 00007 * www.opensg.org * 00008 * * 00009 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de * 00010 * * 00011 \*---------------------------------------------------------------------------*/ 00012 /*---------------------------------------------------------------------------*\ 00013 * License * 00014 * * 00015 * * 00016 * This library is free software; you can redistribute it and/or modify it * 00017 * under the terms of the GNU Library General Public License as published * 00018 * by the Free Software Foundation, version 2. * 00019 * * 00020 * This library is distributed in the hope that it will be useful, but * 00021 * WITHOUT ANY WARRANTY; without even the implied warranty of * 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00023 * Library General Public License for more details. * 00024 * * 00025 * You should have received a copy of the GNU Library General Public * 00026 * License along with this library; if not, write to the Free Software * 00027 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00028 * * 00029 * * 00030 \*---------------------------------------------------------------------------*/ 00031 /*---------------------------------------------------------------------------*\ 00032 * Changes * 00033 * * 00034 * * 00035 * * 00036 * * 00037 * * 00038 * * 00039 \*---------------------------------------------------------------------------*/ 00040 00041 OSG_BEGIN_NAMESPACE 00042 00043 inline Field *getParentsField(FieldContainerPtr pFC, UInt32 uiAspect) 00044 { 00045 if(pFC == NullFC) 00046 return NULL; 00047 00048 FieldContainer *pFCAsp = pFC.getAspectCPtr(uiAspect); 00049 UInt32 uiNumFields = pFCAsp->getType().getNumFieldDescs(); 00050 00051 for(UInt32 uiFieldId = 1; uiFieldId <= uiNumFields; ++uiFieldId) 00052 { 00053 FieldDescription *pDesc = 00054 pFCAsp->getType().getFieldDescription (uiFieldId); 00055 Field *pField = pFCAsp->getField(uiFieldId); 00056 00057 if((strstr(pField->getType().getCName(), "Ptr" ) != NULL) && 00058 (strstr(pDesc->getCName(), "parent") != NULL) ) 00059 { 00060 return pField; 00061 } 00062 } 00063 00064 return NULL; 00065 } 00066 00067 00068 inline bool isSFFieldContainerPtr(Field *pField) 00069 { 00070 if((strstr(pField->getType().getCName(), "Ptr") != NULL) && 00071 (pField->getCardinality() == FieldType::SINGLE_FIELD)) 00072 { 00073 return true; 00074 } 00075 else 00076 { 00077 return false; 00078 } 00079 } 00080 00081 00082 inline bool isMFFieldContainerPtr(Field *pField) 00083 { 00084 if((strstr(pField->getType().getCName(), "Ptr") != NULL) && 00085 (pField->getCardinality() == FieldType::MULTI_FIELD)) 00086 { 00087 return true; 00088 } 00089 else 00090 { 00091 return false; 00092 } 00093 } 00094 00095 OSG_END_NAMESPACE 00096 00097 #define OSGQWIDGETFUNCTIONS_INLINE_CVSID "@(#)$Id: OSGQWidgetFunctions.inl,v 1.1 2003/05/07 14:03:40 neumannc Exp $"
1.5.5