POST
|
Hi, I'm trying to use a billboard symbol from style gallery in globecontrol using IFeatureLayer but I have a problem, the symbol is showed like a rectangle and not show lik billboard In attachments the image of my result I can manage style gallery symbols using IFeatureLayer ? How I can do ? thanks This is my code: Private m_objGlobeControl As AxGlobeControl Private m_FeatureLayer As IFeatureLayer Public Sub AddFeature(ByVal stDati() As st_DataTarget_3d) Create_Layer() AddingFeature(stDati) m_objGlobeControl.GlobeDisplay.RefreshViewers() End Sub Private Sub Create_Layer() Dim pFeatureClass As IFeatureClass pFeatureClass = CreateFeatureClass(esriGeometryType.esriGeometryPoint) Dim pFLy As IFeatureLayer pFLy = New FeatureLayer With pFLy .FeatureClass = pFeatureClass .Name = m_NameLayer .Cached = True .Selectable = True End With Dim pSymbol As ISymbol = LoadStyleSymbol() Dim pColor As IColor = New RgbColor pColor.RGB = RGB(0, 255, 0) pColor.Transparency = 255 Dim markerSymbol As IMarkerSymbol = TryCast(pSymbol, IMarkerSymbol) markerSymbol.Color = pColor markerSymbol.Size = 15 Dim pRend As IFeatureRenderer Dim pSimpleRend As ISimpleRenderer Dim pGeoFL As IGeoFeatureLayer If Not IsNothing(pSymbol) Then pRend = New SimpleRenderer pSimpleRend = pRend pSimpleRend.Symbol = markerSymbol pGeoFL = pFLy pGeoFL.Renderer = pRend End If m_objGlobeControl.Globe.AddLayerType(pFLy, esriGlobeLayerType.esriGlobeLayerTypeDraped, True) m_FeatureLayer = pFLy End Sub Private Sub AddingFeature(ByVal stDati() As st_DataTarget_3d) Dim pFeatureClass As IFeatureClass = Nothing Dim pFeature As IFeature = Nothing Dim pPoint As IPoint pFeatureClass = m_FeatureLayer.FeatureClass pFeature = New Feature For iConta As Integer = 0 To (stDati.Length - 1) If Not IsDBNull(stDati(iConta).Latitudine) And Not IsDBNull(stDati(iConta).Longitudine) Then pFeature = pFeatureClass.CreateFeature pPoint = New Point pPoint.PutCoords(stDati(iConta).Longitudine, stDati(iConta).Latitudine) Dim za As IZAware = TryCast(pPoint, IZAware) za.ZAware = True pPoint.Z = 25 With pFeature .Shape = pPoint .Store() End With End If Next End Sub Private Function CreateFeatureClass(ByVal TipoGeometria As esriGeometryType) As IFeatureClass Dim pFWS As IFeatureWorkspace = Nothing Dim pWorkspaceFactory As IWorkspaceFactory Dim pWorkSpaceName As IWorkspaceName Dim pName As IName Dim pFields As IFields Dim pFieldsEdit As IFieldsEdit Dim pField As IField Dim pFieldEdit As IFieldEdit Dim pGeomDef As IGeometryDef Dim pGeomDefEdit As IGeometryDefEdit Dim pFeatClass As IFeatureClass pWorkspaceFactory = New FileGDBWorkspaceFactoryClass() pFWS = pWorkspaceFactory.OpenFromFile(My.Application.Info.DirectoryPath & "\FGDB\NEMO-TMP-FGDB.gdb", 0) Dim pEnumDS As IEnumDataset = TryCast(pFWS, IWorkspace).Datasets(esriDatasetType.esriDTFeatureClass) Dim pDS As IDataset = pEnumDS.Next Do Until pDS Is Nothing If pDS.Name = m_NameLayer Then pDS.Delete() Exit Do End If pDS = pEnumDS.Next Loop pFields = New Fields pFieldsEdit = pFields pField = New Field pFieldEdit = pField pFieldEdit.Name_2 = "OID" pFieldEdit.Type_2 = esriFieldType.esriFieldTypeOID pFieldsEdit.AddField(pField) pField = New Field pFieldEdit = pField pFieldEdit.Name_2 = "Shape" pFieldEdit.Type_2 = esriFieldType.esriFieldTypeGeometry pGeomDef = New GeometryDef pGeomDefEdit = pGeomDef With pGeomDefEdit .GeometryType_2 = TipoGeometria .SpatialReference_2 = TryCast(m_objGlobeControl.Globe, IBasicMap).SpatialReference .HasZ_2 = True End With pFieldEdit.GeometryDef_2 = pGeomDef pFieldsEdit.AddField(pField) pFeatClass = pFWS.CreateFeatureClass(m_NameLayer, pFields, Nothing, Nothing, esriFeatureType.esriFTSimple, "Shape", "") CreateFeatureClass = pFeatClass End Function Private Function LoadStyleSymbol() As ISymbol Dim styleGallery As IStyleGallery = New ServerStyleGalleryClass() Dim styleStorage As IStyleGalleryStorage = TryCast(styleGallery, IStyleGalleryStorage) styleStorage.TargetFile = "C:\Programmi\ArcGIS\Engine10.0\Styles\3D Billboards.ServerStyle" styleStorage.AddFile("C:\Programmi\ArcGIS\Engine10.0\Styles\3D Billboards.ServerStyle") Dim enumStyleGalleryItem As IEnumStyleGalleryItem = styleGallery.Items("Marker Symbols", "C:\Programmi\ArcGIS\Engine10.0\Styles\3D Billboards.ServerStyle", "") enumStyleGalleryItem.Reset() Dim styleItem As IStyleGalleryItem = enumStyleGalleryItem.Next() While (styleItem IsNot Nothing) If styleItem.Name = "Red Pushpin 3" Then Exit While End If styleItem = enumStyleGalleryItem.Next() End While Dim pSymbol As ISymbol = TryCast(styleItem.Item, ISymbol) Return pSymbol End Function
... View more
04-02-2012
05:07 AM
|
0
|
2
|
573
|
POST
|
thanks Neil you are very kind, I solved it now. I have to used and set IGlobeGraphicsElementProperties, but very important I have to used IGlobeGraphicsLayer It works fine ' Create and add the graphics layer to ArcGlobe Dim globeGraphicsLayer As IGlobeGraphicsLayer = New ESRI.ArcGIS.GlobeCore.GlobeGraphicsLayerClass Dim layer As ESRI.ArcGIS.Carto.ILayer = CType(globeGraphicsLayer, ESRI.ArcGIS.Carto.ILayer) 'Explicit Cast layer.Name = "PIPPO" Dim scene As ESRI.ArcGIS.Analyst3D.IScene = CType(Me.m_objGlobeControl.Globe, ESRI.ArcGIS.Analyst3D.IScene) ' Explicit Cast ' Add the graphics layer scene.AddLayer(layer, True) Dim styleGallery As IStyleGallery = New ServerStyleGalleryClass() Dim styleStorage As IStyleGalleryStorage = TryCast(styleGallery, IStyleGalleryStorage) styleStorage.TargetFile = "C:\Programmi\ArcGIS\Engine10.0\Styles\3D Billboards.ServerStyle" styleStorage.AddFile("C:\Programmi\ArcGIS\Engine10.0\Styles\3D Billboards.ServerStyle") Dim enumStyleGalleryItem As IEnumStyleGalleryItem = styleGallery.Items("Marker Symbols", "C:\Programmi\ArcGIS\Engine10.0\Styles\3D Billboards.ServerStyle", "") enumStyleGalleryItem.Reset() Dim styleItem As IStyleGalleryItem = enumStyleGalleryItem.Next() While (styleItem IsNot Nothing) If styleItem.Name = "Red Pushpin 3" Then Exit While End If styleItem = enumStyleGalleryItem.Next() End While Dim pSymbol As ISymbol = TryCast(styleItem.Item, ISymbol) Dim pColor As IColor = New RgbColor pColor.RGB = RGB(0, 255, 0) pColor.Transparency = 255 Dim pMarkerElement As IMarkerElement = New MarkerElementClass() Dim markerSymbol As IMarkerSymbol = TryCast(pSymbol, IMarkerSymbol) markerSymbol.Color = pColor markerSymbol.Size = 25 ' Set the geometry Dim point As ESRI.ArcGIS.Geometry.IPoint = New ESRI.ArcGIS.Geometry.PointClass point.PutCoords(35.4802, 33.9008) Dim za As IZAware = TryCast(point, IZAware) za.ZAware = True point.Z = 25 Dim markerElement As ESRI.ArcGIS.Carto.IElement = New ESRI.ArcGIS.Carto.MarkerElementClass markerElement.Geometry = point ' Dim GlobeGraphicsProps As IGlobeGraphicsElementProperties = New GlobeGraphicsElementProperties GlobeGraphicsProps.FixedScreenSize = True GlobeGraphicsProps.Rasterize = False ' Add to the graphics layer Dim markerElement_2 As ESRI.ArcGIS.Carto.IMarkerElement = CType(markerElement, ESRI.ArcGIS.Carto.IMarkerElement) ' Explicit Cast markerElement_2.Symbol = markerSymbol globeGraphicsLayer.AddElement(markerElement, GlobeGraphicsProps, 1)
... View more
03-15-2012
07:13 AM
|
0
|
0
|
471
|
POST
|
in my previous post I forgot the attachment with the image, I change : Dim pSymbol As ISymbol = New SimpleMarkerSymbolClass() pSymbol = TryCast(styleItem.Item, ISymbol) in: Dim pSymbol As ISymbol = TryCast(styleItem.Item, ISymbol) but the result is the same thanks
... View more
03-14-2012
07:26 AM
|
0
|
0
|
471
|
POST
|
ahhh you are right Neil, I have correct my code but the symbol is on horizontal plane and not in 3d. Are you sure that my code is correct ? because I suppose it should be used an 3d object (marker) thanks for your effort fabrizio my code correct: Dim globeGraphicsLayer As ESRI.ArcGIS.Carto.IGraphicsContainer = New ESRI.ArcGIS.GlobeCore.GlobeGraphicsLayerClass Dim layer As ESRI.ArcGIS.Carto.ILayer = CType(globeGraphicsLayer, ESRI.ArcGIS.Carto.ILayer) 'Explicit Cast layer.Name = "PIPPO" Dim scene As ESRI.ArcGIS.Analyst3D.IScene = CType(Me.m_objGlobeControl.Globe, ESRI.ArcGIS.Analyst3D.IScene) ' Explicit Cast scene.AddLayer(layer, True) Dim styleGallery As IStyleGallery = New ServerStyleGalleryClass() Dim styleStorage As IStyleGalleryStorage = TryCast(styleGallery, IStyleGalleryStorage) styleStorage.TargetFile = "C:\Programmi\ArcGIS\Engine10.0\Styles\3D Billboards.ServerStyle" styleStorage.AddFile("C:\Programmi\ArcGIS\Engine10.0\Styles\3D Billboards.ServerStyle") Dim enumStyleGalleryItem As IEnumStyleGalleryItem = styleGallery.Items("Marker Symbols", "C:\Programmi\ArcGIS\Engine10.0\Styles\3D Billboards.ServerStyle", "") enumStyleGalleryItem.Reset() Dim styleItem As IStyleGalleryItem = enumStyleGalleryItem.Next() While (styleItem IsNot Nothing) If styleItem.Name = "Red Pushpin 3" Then Exit While End If styleItem = enumStyleGalleryItem.Next() End While Dim pSymbol As ISymbol = New SimpleMarkerSymbolClass() pSymbol = TryCast(styleItem.Item, ISymbol) Dim pColor As IColor = New RgbColor pColor.RGB = RGB(0, 255, 0) pColor.Transparency = 255 Dim point As ESRI.ArcGIS.Geometry.IPoint = New ESRI.ArcGIS.Geometry.PointClass point.PutCoords(35.4802, 33.9008) Dim za As IZAware = TryCast(point, IZAware) za.ZAware = True point.Z = 25 Dim pMarkerElement As IMarkerElement = New MarkerElementClass() Dim markerSymbol As IMarkerSymbol = TryCast(pSymbol, IMarkerSymbol) markerSymbol.Color = pColor markerSymbol.Size = 200 Dim pElement As IElement = TryCast(pMarkerElement, IElement) pElement.Geometry = point pMarkerElement.Symbol = markerSymbol Dim markerElement_2 As ESRI.ArcGIS.Carto.IMarkerElement = CType(pMarkerElement, ESRI.ArcGIS.Carto.IMarkerElement) ' Explicit Cast markerElement_2.Symbol = markerSymbol globeGraphicsLayer.AddElement(pMarkerElement, 1)
... View more
03-14-2012
06:48 AM
|
0
|
0
|
471
|
POST
|
hi, I try to display the symbol, example 3D Billboards.ServerStyle, on arcglobe control. I get ISymbol from gallery and add a GraphicsLayer, but the symbol is not display fine, it's under the data surface. this is my code: Dim globeGraphicsLayer As ESRI.ArcGIS.Carto.IGraphicsContainer = New ESRI.ArcGIS.GlobeCore.GlobeGraphicsLayerClass Dim layer As ESRI.ArcGIS.Carto.ILayer = CType(globeGraphicsLayer, ESRI.ArcGIS.Carto.ILayer) 'Explicit Cast layer.Name = "PIPPO" Dim scene As ESRI.ArcGIS.Analyst3D.IScene = CType(Me.m_objGlobeControl.Globe, ESRI.ArcGIS.Analyst3D.IScene) ' Explicit Cast scene.AddLayer(layer, True) Dim styleGallery As IStyleGallery = New ServerStyleGalleryClass() Dim styleStorage As IStyleGalleryStorage = TryCast(styleGallery, IStyleGalleryStorage) styleStorage.TargetFile = "C:\Programmi\ArcGIS\Engine10.0\Styles\3D Billboards.ServerStyle" styleStorage.AddFile("C:\Programmi\ArcGIS\Engine10.0\Styles\3D Billboards.ServerStyle") Dim enumStyleGalleryItem As IEnumStyleGalleryItem = styleGallery.Items("Marker Symbols", "C:\Programmi\ArcGIS\Engine10.0\Styles\3D Billboards.ServerStyle", "") enumStyleGalleryItem.Reset() Dim styleItem As IStyleGalleryItem = enumStyleGalleryItem.Next() While (styleItem IsNot Nothing) If styleItem.Name = "Red Pushpin 3" Then Exit While End If styleItem = enumStyleGalleryItem.Next() End While Dim pSymbol As ISymbol = New SimpleMarkerSymbolClass() pSymbol = TryCast(styleItem.Item, ISymbol) Dim pColor As IColor = New RgbColor pColor.RGB = RGB(0, 255, 0) pColor.Transparency = 255 Dim point As ESRI.ArcGIS.Geometry.IPoint = New ESRI.ArcGIS.Geometry.PointClass point.PutCoords(35.4802, 33.9008) Dim pMarkerElement As IMarkerElement = New MarkerElementClass() Dim markerSymbol As IMarkerSymbol = TryCast(pSymbol, IMarkerSymbol) markerSymbol.Color = pColor markerSymbol.Size = 200 Dim pElement As IElement = TryCast(pMarkerElement, IElement) pElement.Geometry = point pMarkerElement.Symbol = markerSymbol Dim markerElement_2 As ESRI.ArcGIS.Carto.IMarkerElement = CType(pMarkerElement, ESRI.ArcGIS.Carto.IMarkerElement) ' Explicit Cast markerElement_2.Symbol = markerSymbol globeGraphicsLayer.AddElement(pMarkerElement, 1) thanks
... View more
03-14-2012
03:27 AM
|
0
|
7
|
621
|
POST
|
Thanks Duncan, You are right, I forget this, I didn't re-consulted the documentation. thanks Fabrizio
... View more
01-26-2011
09:50 PM
|
0
|
0
|
421
|
POST
|
Hi, Is possible to use ToRasterDataset with workspace into memory ? Dim pTransformationOp As ITransformationOp = New ESRI.ArcGIS.GeoAnalyst.RasterTransformationOp Dim pWSF As IWorkspaceFactory = New InMemoryWorkspaceFactory Dim pWS As IWorkspace = Nothing Dim pWorkSpaceName As IWorkspaceName Dim pName As IName Dim pGeoDS As IGeoDataset = Nothing Dim rasterWorkspaceFactory As New RasterWorkspaceFactoryClass() Dim rasterWorkspace As IWorkspace = Nothing Dim rasterConversionOp As New RasterConversionOpClass() Dim pRasterEnv As IRasterAnalysisEnvironment = Nothing Dim pEnvelopeClip As IEnvelope = Nothing pEnvelopeClip = IncreseEnvelope(pPolygon.Envelope, iPercentageIncreseAreaClip) pRasterEnv = CType(pTransformationOp, IRasterAnalysisEnvironment) pRasterEnv.SetExtent(esriRasterEnvSettingEnum.esriRasterEnvValue, pEnvelopeClip) pTransformationOp = pRasterEnv pGeoDS = pTransformationOp.Clip(pRasterTerrainSurface, pEnvelopeClip) pWorkSpaceName = pWSF.Create("", cFileNameSurfaceAreaClip, Nothing, 0) pName = TryCast(pWorkSpaceName, IName) pWS = TryCast(pName.Open, IWorkspace) ClipLayerSurfaceOnAOI = rasterConversionOp.ToRasterDataset(pGeoDS, "TIFF", pWS, cFileNameSurfaceAreaClip) thanks at all fabrizio
... View more
01-26-2011
04:33 AM
|
0
|
3
|
534
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|