<commit_before>package org.glob3.mobile.generated; 
//
//  SGTextureNode.cpp
//  G3MiOSSDK
//
//  Created by <NAME> on 11/8/12.
//
//

//
//  SGTextureNode.hpp
//  G3MiOSSDK
//
//  Created by <NAME> on 11/8/12.
//
//



//C++ TO JAVA CONVERTER NOTE: Java has no need of forward class declarations:
//class SGLayerNode;

public class SGTextureNode extends SGNode
{
  private java.util.ArrayList<SGLayerNode> _layers = new java.util.ArrayList<SGLayerNode>();

  public SGTextureNode(String id, String sId)
  {
	  super(id, sId);

  }

  public void dispose()
  {
	final int layersCount = _layers.size();
	for (int i = 0; i < layersCount; i++)
	{
	  SGLayerNode layer = _layers.get(i);
	  if (layer != null)
		  layer.dispose();
	}
  }

  public final void addLayer(SGLayerNode layer)
  {
	_layers.add(layer);
  
	if (_context != null)
	{
	  layer.initialize(_context, _shape);
	}
  }

  public final boolean isReadyToRender(G3MRenderContext rc)
  {
	final int layersCount = _layers.size();
	for (int i = 0; i < layersCount; i++)
	{
	  SGLayerNode layer = _layers.get(i);
	  if (!layer.isReadyToRender(rc))
	  {
		return false;
	  }
	}
  
	return super.isReadyToRender(rc);
  }


  //void SGTextureNode::rawRender(const G3MRenderContext* rc,
  //                              const GLState& parentState) {
  //  const int layersCount = _layers.size();
  //  for (int i = 0; i < layersCount; i++) {
  //    SGLayerNode* layer = _layers[i];
  //
  //    const GLState* layerState = layer->createState(rc, parentState);
  //    const GLState* state;
  //    if (layerState == NULL) {
  //      state = &parentState;
  //    }
  //    else {
  //      state = layerState;
  //    }
  //
  //    layer->rawRender(rc, *state);
  //
  //    delete layerState;
  //  }
  //}
  
  public final void initialize(G3MContext context, SGShape shape)
  {
	super.initialize(context, shape);
  
	final int layersCount = _layers.size();
	for (int i = 0; i < layersCount; i++)
	{
	  SGLayerNode child = _layers.get(i);
	  child.initialize(context, shape);
	}
  }

//  void rawRender(const G3MRenderContext* rc,
//                 const GLState& parentState);

  public final void prepareRender(G3MRenderContext rc)
  {
	final int layersCount = _layers.size();
	for (int i = 0; i < layersCount; i++)
	{
	  SGLayerNode layer = _layers.get(i);
	  layer.prepareRender(rc);
	}
  }

  public final void cleanUpRender(G3MRenderContext rc)
  {
	final int layersCount = _layers.size();
	for (int i = 0; i < layersCount; i++)
	{
	  SGLayerNode layer = _layers.get(i);
	  layer.cleanUpRender(rc);
	}
  }

  public final GLState createState(G3MRenderContext rc, GLState parentState)
  {
	return null;
  }

  public final void render(G3MRenderContext rc, GLState parentState)
  {
	final GLState myState = createState(rc, parentState);
	final GLState state;
	if (myState == null)
	{
	  state = parentState;
	}
	else
	{
	  state = myState;
	}
  
	prepareRender(rc);
  
	//  rawRender(rc, *state);
  
	final int layersCount = _layers.size();
	for (int i = 0; i < layersCount; i++)
	{
	  SGLayerNode layer = _layers.get(i);
  
	  final GLState layerState = layer.createState(rc, state);
	  final GLState state;
	  if (layerState == null)
	  {
		state = parentState;
	  }
	  else
	  {
		state = layerState;
	  }
  
	  layer.rawRender(rc, state);
  
	  final int childrenCount = _children.size();
	  for (int i = 0; i < childrenCount; i++)
	  {
		SGNode child = _children.get(i);
		child.render(rc, state);
	  }
  
	  if (layerState != null)
		  layerState.dispose();
	}
  
	cleanUpRender(rc);
  
	if (myState != null)
		myState.dispose();
  }


}<commit_msg>Generated<commit_after>package org.glob3.mobile.generated; 
//
//  SGTextureNode.cpp
//  G3MiOSSDK
//
//  Created by <NAME> on 11/8/12.
//
//

//
//  SGTextureNode.hpp
//  G3MiOSSDK
//
//  Created by <NAME> on 11/8/12.
//
//



//C++ TO JAVA CONVERTER NOTE: Java has no need of forward class declarations:
//class SGLayerNode;

public class SGTextureNode extends SGNode
{
  private java.util.ArrayList<SGLayerNode> _layers = new java.util.ArrayList<SGLayerNode>();

  public SGTextureNode(String id, String sId)
  {
	  super(id, sId);

  }

  public void dispose()
  {
	final int layersCount = _layers.size();
	for (int i = 0; i < layersCount; i++)
	{
	  SGLayerNode layer = _layers.get(i);
	  if (layer != null)
		  layer.dispose();
	}
  }

  public final void addLayer(SGLayerNode layer)
  {
	_layers.add(layer);
  
	if (_context != null)
	{
	  layer.initialize(_context, _shape);
	}
  }

  public final boolean isReadyToRender(G3MRenderContext rc)
  {
	final int layersCount = _layers.size();
	for (int i = 0; i < layersCount; i++)
	{
	  SGLayerNode layer = _layers.get(i);
	  if (!layer.isReadyToRender(rc))
	  {
		return false;
	  }
	}
  
	return super.isReadyToRender(rc);
  }


  //void SGTextureNode::rawRender(const G3MRenderContext* rc,
  //                              const GLState& parentState) {
  //  const int layersCount = _layers.size();
  //  for (int i = 0; i < layersCount; i++) {
  //    SGLayerNode* layer = _layers[i];
  //
  //    const GLState* layerState = layer->createState(rc, parentState);
  //    const GLState* state;
  //    if (layerState == NULL) {
  //      state = &parentState;
  //    }
  //    else {
  //      state = layerState;
  //    }
  //
  //    layer->rawRender(rc, *state);
  //
  //    delete layerState;
  //  }
  //}
  
  public final void initialize(G3MContext context, SGShape shape)
  {
	super.initialize(context, shape);
  
	final int layersCount = _layers.size();
	for (int i = 0; i < layersCount; i++)
	{
	  SGLayerNode child = _layers.get(i);
	  child.initialize(context, shape);
	}
  }

//  void rawRender(const G3MRenderContext* rc,
//                 const GLState& parentState);

  public final void prepareRender(G3MRenderContext rc)
  {
	final int layersCount = _layers.size();
	for (int i = 0; i < layersCount; i++)
	{
	  SGLayerNode layer = _layers.get(i);
	  layer.prepareRender(rc);
	}
  }

  public final void cleanUpRender(G3MRenderContext rc)
  {
	final int layersCount = _layers.size();
	for (int i = 0; i < layersCount; i++)
	{
	  SGLayerNode layer = _layers.get(i);
	  layer.cleanUpRender(rc);
	}
  }

  public final GLState createState(G3MRenderContext rc, GLState parentState)
  {
	return null;
  }

  public final void render(G3MRenderContext rc, GLState parentState)
  {
	final GLState myState = createState(rc, parentState);
	final GLState state;
	if (myState == null)
	{
	  state = parentState;
	}
	else
	{
	  state = myState;
	}
  
	prepareRender(rc);
  
	//  rawRender(rc, *state);
  
	final int layersCount = _layers.size();
	for (int i = 0; i < layersCount; i++)
	{
	  SGLayerNode layer = _layers.get(i);
  
	  final GLState layerState = layer.createState(rc, state);
	  final GLState state;
	  if (layerState == null)
	  {
		state = parentState;
	  }
	  else
	  {
		state = layerState;
	  }
  
	  layer.rawRender(rc, state);
  
	  final int childrenCount = _children.size();
	  for (int j = 0; j < childrenCount; j++)
	  {
		SGNode child = _children.get(j);
		child.render(rc, state);
	  }
  
	  if (layerState != null)
		  layerState.dispose();
	}
  
	cleanUpRender(rc);
  
	if (myState != null)
		myState.dispose();
  }


}
{'fraction_non_alphanumeric': 0.1302974466964991, 'fraction_numerical': 0.007633587786259542, 'mean_word_length': 2.2796719896417783, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2405621', 'n_tokens_mistral': 2885, 'n_tokens_neox': 2637, 'n_words': 620}