bool GetFeatureRequest::Create(rude::CGI& cgi, Map* pMap) { WebContext* pWebContext = augeGetWebContextInstance(); char parameter[AUGE_NAME_MAX]; SetVersion(cgi["version"]); //auge_web_parameter_encoding(, parameter, AUGE_NAME_MAX, pWebContext->IsIE()); SetTypeName(cgi["typeName"],true); auge_web_parameter_encoding(cgi["sourceName"], parameter, AUGE_NAME_MAX, pWebContext->IsIE()); SetSourceName(parameter); //auge_web_parameter_encoding(cgi["mapName"], parameter, AUGE_NAME_MAX, pWebContext->IsIE()); SetMapName(cgi["mapName"], true); SetOutputFormat(cgi["outputFormat"]); SetMaxFeatures(cgi["maxFeatures"]); SetOffset(cgi["offset"]); SetBBox(cgi["bbox"]); SetEncoding(cgi["encoding"]); m_filter = cgi["filter"]; m_fields = cgi["fields"]; //if(!m_extent.IsValid()) //{ // SetQuery(cgi["filter"],cgi["fields"], GetTypeName(), pMap); //} return true; }
MActorRes::MActorRes(const TString128 & source) : mActor(NULL) , mAabb(Aabb::Invalid) , mSphere(Sphere::Zero) { SetSourceName(source); }
bool RemoveTileStoreRequest::Create(rude::CGI& cgi) { SetVersion(cgi["version"]); SetSourceName(cgi["sourceName"]); SetStoreName(cgi["storeName"]); return true; }
bool WFSCapabilitiesRequest::Create(rude::CGI& cgi) { const char* val = NULL; SetVersion(cgi["version"]); SetUser(cgi["user"]); SetSourceName(cgi["sourceName"]); SetMapName(cgi["mapName"],true); return true; }
bool GetPreviewRequest::Create(rude::CGI& cgi) { SetVersion(cgi["version"]); SetSourceName(cgi["sourceName"]); SetDataSetName(cgi["dataSetName"]); SetWidth(cgi["width"]); SetHeight(cgi["height"]); SetExtent(cgi["bbox"]); return true; }
bool GetValueRequest::Create(rude::CGI& cgi) { SetVersion(cgi["version"]); SetPath(cgi["Path"]); SetRasterName(cgi["rasterName"]); SetSourceName(cgi["sourceName"]); SetIX(cgi["sx"]); SetIY(cgi["sy"]); SetX(cgi["x"]); SetY(cgi["y"]); return true; }
bool GetCountRequest::Create(rude::CGI& cgi, Map* pMap) { SetVersion(cgi["version"]); SetTypeName(cgi["typeName"]); SetSourceName(cgi["sourceName"]); SetMapName(cgi["mapName"],true); SetBBox(cgi["bbox"]); m_filter = cgi["filter"]; return true; }
bool GetCountRequest::Create(XDocument* pxDoc) { XElement *pxRoot = NULL; XAttribute *pxAttr = NULL; m_pxDoc = pxDoc; pxRoot = pxDoc->GetRootNode(); pxAttr = pxRoot->GetAttribute("version"); if(pxAttr!=NULL) { SetVersion(pxAttr->GetValue()); } pxAttr = pxRoot->GetAttribute("mapName"); if(pxAttr!=NULL) { SetMapName(pxAttr->GetValue(),false); } pxAttr = pxRoot->GetAttribute("sourceName"); if(pxAttr!=NULL) { SetSourceName(pxAttr->GetValue()); } XElement* pxQuery = (XElement*)pxRoot->GetFirstChild("Query"); if(pxQuery==NULL) { return NULL; } pxAttr = pxQuery->GetAttribute("typeName"); if(pxAttr==NULL) { return false; } SetTypeName(pxAttr->GetValue(),false); if(m_type_name.empty()) { return false; } return true; }
bool UpdateTileRequest::Create(rude::CGI& cgi) { const char* val = NULL; SetVersion(cgi["version"]); SetUser(cgi["user"]); SetTypeName(cgi["typeName"]); SetMapName(cgi["mapName"]); SetSourceName(cgi["sourceName"]); SetTileStoreName(cgi["tileStore"]); SetLevel(cgi["level"]); SetRow(cgi["row"]); SetCol(cgi["col"]); return true; }
bool GetFeatureRequest::Create(XDocument* pxDoc) { XElement *pxRoot = NULL; XAttribute *pxAttr = NULL; m_pxDoc = pxDoc; pxRoot = pxDoc->GetRootNode(); pxAttr = pxRoot->GetAttribute("version"); if(pxAttr!=NULL) { SetVersion(pxAttr->GetValue()); } pxAttr = pxRoot->GetAttribute("mapName"); if(pxAttr!=NULL) { SetMapName(pxAttr->GetValue(),false); } pxAttr = pxRoot->GetAttribute("sourceName"); if(pxAttr!=NULL) { SetSourceName(pxAttr->GetValue()); } pxAttr = pxRoot->GetAttribute("outputFormat"); if(pxAttr!=NULL) { GLogger* pLogger = augeGetLoggerInstance(); pLogger->Trace(pxAttr->GetValue(),__FILE__,__LINE__); SetOutputFormat(pxAttr->GetValue()); } pxAttr = pxRoot->GetAttribute("maxFeatures"); if(pxAttr!=NULL) { SetMaxFeatures(pxAttr->GetValue()); } pxAttr = pxRoot->GetAttribute("offset"); if(pxAttr!=NULL) { SetOffset(pxAttr->GetValue()); } pxAttr = pxRoot->GetAttribute("encoding"); if(pxAttr!=NULL) { SetEncoding(pxAttr->GetValue()); } XElement* pxQuery = (XElement*)pxRoot->GetFirstChild("Query"); if(pxQuery==NULL) { return NULL; } pxAttr = pxQuery->GetAttribute("typeName"); if(pxAttr==NULL) { return false; } SetTypeName(pxAttr->GetValue(), false); if(m_type_name.empty()) { return false; } //Layer* pLayer = NULL; //pLayer = pMap->GetLayer(m_type_name.c_str()); //if(pLayer==NULL) //{ // return false; //} //if(pLayer->GetType()!=augeLayerFeature) //{ // return false; //} //FeatureLayer* pFLayer = NULL; //FeatureClass* pFeatureClass = NULL; //pFLayer = static_cast<FeatureLayer*>(pLayer); //pFeatureClass = pFLayer->GetFeatureClass(); //if(pFeatureClass==NULL) //{ // return false; //} //FilterFactory* pFilterFactory = augeGetFilterFactoryInstance(); //m_pQuery = pFilterFactory->CreateQuery(); //XElement* pxFilter = (XElement*)pxQuery->GetFirstChild("Filter"); //if(pxFilter!=NULL) //{ // GFilter* pFilter = NULL; // FilterReader* reader = pFilterFactory->CreateFilerReader(pFeatureClass->GetFields()); // pFilter = reader->Read(pxFilter); // m_pQuery->SetFilter(pFilter); //} ////PropertyName //char field_name[AUGE_NAME_MAX]; //const char* property_name; //XNode* pxNode = NULL; //XNodeSet* pxNodeSet = pxQuery->GetChildren("PropertyName"); //pxNodeSet->Reset(); //while((pxNode=pxNodeSet->Next())!=NULL) //{ // property_name = pxNode->GetContent(); // ParseFieldName(property_name, field_name, AUGE_NAME_MAX); // m_pQuery->AddSubField(field_name); //} //pxNodeSet->Release(); return true; }
//-***************************************************************************** void OPolyMeshSchema::set( const Sample &iSamp ) { ALEMBIC_ABC_SAFE_CALL_BEGIN( "OPolyMeshSchema::set()" ); // do we need to create velocities prop? if ( iSamp.getVelocities() && !m_velocitiesProperty ) { m_velocitiesProperty = Abc::OV3fArrayProperty( this->getPtr(), ".velocities", m_positionsProperty.getTimeSampling() ); std::vector<V3f> emptyVec; const V3fArraySample empty( emptyVec ); const size_t numSamps = m_positionsProperty.getNumSamples(); for ( size_t i = 0 ; i < numSamps ; ++i ) { m_velocitiesProperty.set( empty ); } } // do we need to create uvs? if ( iSamp.getUVs() && !m_uvsParam ) { std::vector<V2f> emptyVals; std::vector<Util::uint32_t> emptyIndices; OV2fGeomParam::Sample empty; AbcA::MetaData mdata; SetSourceName( mdata, m_uvSourceName ); if ( iSamp.getUVs().getIndices() ) { empty = OV2fGeomParam::Sample( Abc::V2fArraySample( emptyVals ), Abc::UInt32ArraySample( emptyIndices ), iSamp.getUVs().getScope() ); // UVs are indexed m_uvsParam = OV2fGeomParam( this->getPtr(), "uv", true, empty.getScope(), 1, this->getTimeSampling(), mdata ); } else { empty = OV2fGeomParam::Sample( Abc::V2fArraySample( emptyVals ), iSamp.getUVs().getScope() ); // UVs are not indexed m_uvsParam = OV2fGeomParam( this->getPtr(), "uv", false, empty.getScope(), 1, this->getTimeSampling() , mdata ); } size_t numSamples = m_positionsProperty.getNumSamples(); // set all the missing samples for ( size_t i = 0; i < numSamples; ++i ) { m_uvsParam.set( empty ); } } // do we need to create normals? if ( iSamp.getNormals() && !m_normalsParam ) { std::vector<V3f> emptyVals; std::vector<Util::uint32_t> emptyIndices; ON3fGeomParam::Sample empty; if ( iSamp.getNormals().getIndices() ) { empty = ON3fGeomParam::Sample( Abc::V3fArraySample( emptyVals ), Abc::UInt32ArraySample( emptyIndices ), iSamp.getNormals().getScope() ); // normals are indexed m_normalsParam = ON3fGeomParam( this->getPtr(), "N", true, empty.getScope(), 1, this->getTimeSampling() ); } else { empty = ON3fGeomParam::Sample( Abc::V3fArraySample( emptyVals ), iSamp.getNormals().getScope() ); // normals are not indexed m_normalsParam = ON3fGeomParam( this->getPtr(), "N", false, empty.getScope(), 1, this->getTimeSampling() ); } size_t numSamples = m_positionsProperty.getNumSamples(); // set all the missing samples for ( size_t i = 0; i < numSamples; ++i ) { m_normalsParam.set( empty ); } } // We could add sample integrity checking here. if ( m_positionsProperty.getNumSamples() == 0 ) { // First sample must be valid on all points. ABCA_ASSERT( iSamp.getPositions() && iSamp.getFaceIndices() && iSamp.getFaceCounts(), "Sample 0 must have valid data for all mesh components" ); m_positionsProperty.set( iSamp.getPositions() ); m_indicesProperty.set( iSamp.getFaceIndices() ); m_countsProperty.set( iSamp.getFaceCounts() ); if ( m_velocitiesProperty ) { SetPropUsePrevIfNull( m_velocitiesProperty, iSamp.getVelocities() ); } if ( iSamp.getSelfBounds().isEmpty() ) { // OTypedScalarProperty::set() is not referentially transparent, // so we need a a placeholder variable. Abc::Box3d bnds( ComputeBoundsFromPositions( iSamp.getPositions() ) ); m_selfBoundsProperty.set( bnds ); } else { m_selfBoundsProperty.set( iSamp.getSelfBounds() ); } if ( iSamp.getUVs().getVals() ) { m_uvsParam.set( iSamp.getUVs() ); } if ( iSamp.getNormals().getVals() ) { m_normalsParam.set( iSamp.getNormals() ); } } else { SetPropUsePrevIfNull( m_positionsProperty, iSamp.getPositions() ); SetPropUsePrevIfNull( m_indicesProperty, iSamp.getFaceIndices() ); SetPropUsePrevIfNull( m_countsProperty, iSamp.getFaceCounts() ); if ( m_velocitiesProperty ) { SetPropUsePrevIfNull( m_velocitiesProperty, iSamp.getVelocities() ); } if ( iSamp.getSelfBounds().hasVolume() ) { m_selfBoundsProperty.set( iSamp.getSelfBounds() ); } else if ( iSamp.getPositions() ) { Abc::Box3d bnds( ComputeBoundsFromPositions( iSamp.getPositions() ) ); m_selfBoundsProperty.set( bnds ); } else { m_selfBoundsProperty.setFromPrevious(); } // OGeomParam will automatically use SetPropUsePrevIfNull internally if ( m_uvsParam ) { m_uvsParam.set( iSamp.getUVs() ); } if ( m_normalsParam ) { m_normalsParam.set( iSamp.getNormals() ); } } ALEMBIC_ABC_SAFE_CALL_END(); }