.. role:: ts-api-decorator

########
BCFTopic
########

.. js:module:: Bcf
   :noindex:

.. container:: ts-api-section

   .. js:class:: BCFTopic

      This class contains data corresponding to a BCF file topic.



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~Bcf.BCFTopic.constructor`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~Bcf.BCFTopic.addMarkup`
   * :js:meth:`~Bcf.BCFTopic.addSnapshot`
   * :js:meth:`~Bcf.BCFTopic.addViewpoint`
   * :js:meth:`~Bcf.BCFTopic.getMarkup`
   * :js:meth:`~Bcf.BCFTopic.getSnapshot`
   * :js:meth:`~Bcf.BCFTopic.getSnapshotMap`
   * :js:meth:`~Bcf.BCFTopic.getTopicId`
   * :js:meth:`~Bcf.BCFTopic.getViewpoint`
   * :js:meth:`~Bcf.BCFTopic.getViewpointMap`
   * :js:meth:`~Bcf.BCFTopic.setSnapshot`
   * :js:meth:`~Bcf.BCFTopic.setViewpoint`
   * :js:meth:`~Bcf.BCFTopic.createTopic`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: BCFTopic.constructor( bcfDataId, bcfFilename, topicId, viewer)

      :param bcfDataId: None
      :type bcfDataId: number
      :param bcfFilename: None
      :type bcfFilename: string
      :param topicId: None
      :type topicId: string
      :param viewer: None
      :type viewer: WebViewer


      :rtype: BCFTopic



Methods
=======

.. rst-class:: ts-api-section

addMarkup
---------

.. js:method:: BCFTopic.addMarkup( filename, document)

   :param filename: None
   :type filename: string
   :param document: None
   :type document: null | Document


   Adds a BCF markup.


   :rtype: BCFMarkup

.. rst-class:: ts-api-section

addSnapshot
-----------

.. js:method:: BCFTopic.addSnapshot( filename, png)

   :param filename: None
   :type filename: string
   :param png: Image data.
   :type png: Uint8Array


   Creates and adds a Snapshot.


   :rtype: void

.. rst-class:: ts-api-section

addViewpoint
------------

.. js:method:: BCFTopic.addViewpoint( filename, document, version, modelBounding, modelUnits)

   :param filename: None
   :type filename: string
   :param document: None
   :type document: null | Document
   :param version: None
   :type version: BCFVersion
   :param modelBounding: None
   :type modelBounding: Box
   :param modelUnits: None
   :type modelUnits: number


   Creates and adds BCF viewpoint.


   :rtype: BCFViewpoint

.. rst-class:: ts-api-section

getMarkup
---------

.. js:method:: BCFTopic.getMarkup()





   :returns: BCF markup data.


   :rtype: BCFMarkup

.. rst-class:: ts-api-section

getSnapshot
-----------

.. js:method:: BCFTopic.getSnapshot( filename)

   :param filename: snapshot or corresponding viewpoint filename
   :type filename: string


   Gets snapshot data.


   :rtype: null | BCFSnapshot

.. rst-class:: ts-api-section

getSnapshotMap
--------------

.. js:method:: BCFTopic.getSnapshotMap()





   :returns: A map associating snapshot filenames with snapshot data.


   :rtype: Map <string, BCFSnapshot>

.. rst-class:: ts-api-section

getTopicId
----------

.. js:method:: BCFTopic.getTopicId()



   Gets the topic id corresponding to the BCF topic folder.


   :rtype: string

.. rst-class:: ts-api-section

getViewpoint
------------

.. js:method:: BCFTopic.getViewpoint( filename)

   :param filename: viewpoint filename.
   :type filename: string


   Gets viewpoint data.


   :rtype: null | BCFViewpoint

.. rst-class:: ts-api-section

getViewpointMap
---------------

.. js:method:: BCFTopic.getViewpointMap()





   :returns: A map associating viewpoint filenames with viewpoint data.


   :rtype: Map <string, BCFViewpoint>

.. rst-class:: ts-api-section

setSnapshot
-----------

.. js:method:: BCFTopic.setSnapshot( filename, snapshot)

   :param filename: None
   :type filename: string
   :param snapshot: None
   :type snapshot: BCFSnapshot


   Adds a BCF Snapshot. If there is already a snapshot with the smae filename, it will be replaced.


   :rtype: void

.. rst-class:: ts-api-section

setViewpoint
------------

.. js:method:: BCFTopic.setViewpoint( filename, viewpoint)

   :param filename: None
   :type filename: string
   :param viewpoint: None
   :type viewpoint: BCFViewpoint


   Adds a BCF Viewpoint. If there is a already a viewpoint with the same filename, it will be replaced.


   :rtype: void

.. rst-class:: ts-api-section

:ts-api-decorator:`static` createTopic
--------------------------------------

.. js:method:: BCFTopic.createTopic( viewer, bcfDataId, bcfFilename, topicTitle, markupView)

   :param viewer: None
   :type viewer: WebViewer
   :param bcfDataId: None
   :type bcfDataId: number
   :param bcfFilename: None
   :type bcfFilename: string
   :param topicTitle: None
   :type topicTitle: string
   :param markupView: None
   :type markupView: null | MarkupView


   Takes a MarkupView and creates a BCF Topic from it.


   :rtype: Promise <BCFTopic>

